示例#1
0
        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);
            }
        }
示例#2
0
        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);
        }
示例#3
0
 public void AssignToGraph(TerraGraph graph)
 {
     this.graph = graph;
 }