void OnEnable() { InitToolRes(); if (currentGraph == null) { currentGraph = ScriptableObject.CreateInstance <UIGraph>(); Vector2 pos = new Vector2(position.width / 2, position.height / 2); currentGraph.AddNode <RootNode>(pos); } _willRepaint = true; _zoomPivotPos = new Vector2(position.width / 2, position.height / 2); EditorApplication.playmodeStateChanged += PlayModeChange; }
public void AddUIGraphNode(UIGraphNode node) { Graph.AddNode(node); DrawGraph(); }