using System; using System.Collections.Generic; using System.Linq; using UnityEditor.Experimental.UIElements.GraphView; using UnityEditor.Graphing; using UnityEngine; using UnityEngine.Experimental.UIElements; using UnityEngine.Experimental.UIElements.StyleEnums; using UnityEngine.Experimental.UIElements.StyleSheets; namespace UnityEditor.ShaderGraph.Drawing { class BlackboardProvider { readonly AbstractMaterialGraph m_Graph; readonly Texture2D m_ExposedIcon; 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; //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; } //} public string assetName { get { return blackboard.title; } set { blackboard.title = value; } } public BlackboardProvider(AbstractMaterialGraph graph) { m_Graph = graph; m_ExposedIcon = Resources.Load("GraphView/Nodes/BlackboardFieldExposed"); m_PropertyRows = new Dictionary(); blackboard = new Blackboard() { scrollable = true, subTitle = FormatPath(graph.path), editTextRequested = EditTextRequested, addItemRequested = AddItemRequested, moveItemRequested = MoveItemRequested }; m_PathLabel = blackboard.shadow.ElementAt(0).Q