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_InputRows; readonly BlackboardSection m_PropertySection; readonly BlackboardSection m_KeywordSection; public Blackboard blackboard { get; private set; } Label m_PathLabel; TextField m_PathLabelTextField; bool m_EditPathCancelled = false; List m_SelectedNodes = new List(); Dictionary m_ExpandedInputs = new Dictionary(); public Dictionary expandedInputs { get { return m_ExpandedInputs; } } public string assetName { get { return blackboard.title; } set { blackboard.title = value; } } public BlackboardProvider(GraphData graph) { m_Graph = graph; m_InputRows = new Dictionary(); blackboard = new Blackboard() { scrollable = true, subTitle = FormatPath(graph.path), editTextRequested = EditTextRequested, addItemRequested = AddItemRequested, moveItemRequested = MoveItemRequested }; m_PathLabel = blackboard.hierarchy.ElementAt(0).Q