public static void Open(TerraGraph graph) { Graph = graph; HeldSocket = null; Window = GetWindow <TerraGraphEditor>(false, "Terra Graph Editor", true); if (!Graph.ContainsOutNode()) { Graph.Clear(); Window.CreateNode(typeof(OutNode), Window.position.size * 0.5f); } }
public static bool OnOpen(int instanceID, int line) { // Convert the instance ID to the TerraGraph object. TerraGraph graph = EditorUtility.InstanceIDToObject(instanceID) as TerraGraph; // Valid asset if (graph != null) { graph.RebuildConnections(); TerraGraphEditor.Open(graph); return(true); } // Invalid asset return(false); }
public void AssignToGraph(TerraGraph graph) { this.graph = graph; }