using System; using System.Collections.Generic; using System.Linq; using UnityEditor.Graphing; using UnityEngine; using UnityEditor.Experimental.GraphView; using UnityEngine.UIElements; namespace UnityEditor.ShaderGraph.Drawing { class BlackboardProvider { readonly GraphData m_Graph; public static readonly Texture2D exposedIcon = Resources.Load("GraphView/Nodes/BlackboardFieldExposed"); readonly Dictionary m_PropertyRows; readonly BlackboardSection m_Section; //WindowDraggable m_WindowDraggable; //ResizeBorderFrame m_ResizeBorderFrame; public Blackboard blackboard { get; private set; } Label m_PathLabel; TextField m_PathLabelTextField; bool m_EditPathCancelled = false; List m_SelectedNodes = new List(); //public Action onDragFinished //{ // get { return m_WindowDraggable.OnDragFinished; } // set { m_WindowDraggable.OnDragFinished = value; } //} //public Action onResizeFinished //{ // get { return m_ResizeBorderFrame.OnResizeFinished; } // set { m_ResizeBorderFrame.OnResizeFinished = value; } //} Dictionary m_ExpandedProperties = new Dictionary(); public Dictionary expandedProperties { get { return m_ExpandedProperties; } } public string assetName { get { return blackboard.title; } set { blackboard.title = value; } } public BlackboardProvider(GraphData graph) { m_Graph = graph; m_PropertyRows = new Dictionary(); blackboard = new Blackboard() { scrollable = true, subTitle = FormatPath(graph.path), editTextRequested = EditTextRequested, addItemRequested = AddItemRequested, moveItemRequested = MoveItemRequested }; m_PathLabel = blackboard.hierarchy.ElementAt(0).Q