void OnEnable() { Slot start = null; if (stateMachineGraph == null) { stateMachineGraph = ScriptableObject.CreateInstance <Graph> (); stateMachineGraph.hideFlags = HideFlags.HideAndDontSave; Node node = ScriptableObject.CreateInstance <Node>(); node.title = "mile2"; node.position = new Rect(400, 34, 300, 200); //node.style node.AddInputSlot("input"); start = node.AddOutputSlot("output"); node.AddProperty(new Property(typeof(System.Int32), "integer")); stateMachineGraph.AddNode(node); } if (stateMachineGraphGUI == null) { Node node = ScriptableObject.CreateInstance <Node>(); node.title = "mile"; node.position = new Rect(0, 0, 300, 200); //node.style=Styles. Slot end = node.AddInputSlot("input"); node.AddOutputSlot("output"); node.AddProperty(new Property(typeof(System.Int32), "integer")); stateMachineGraph.AddNode(node); stateMachineGraph.Connect(start, end); stateMachineGraphGUI = (GetEditor(stateMachineGraph)); } }
GraphGUIEx GetEditor(Graph graph) { GraphGUIEx graphGUI = ScriptableObject.CreateInstance <GraphGUIEx>(); graphGUI.graph = graph; graphGUI.hideFlags = HideFlags.HideAndDontSave; return(graphGUI); }
void OnEnable() { Slot start=null; if (stateMachineGraph == null) { stateMachineGraph = ScriptableObject.CreateInstance<Graph> (); stateMachineGraph.hideFlags = HideFlags.HideAndDontSave; Node node=ScriptableObject.CreateInstance<Node>(); node.title="mile2"; node.position=new Rect(400,34,300,200); //node.style node.AddInputSlot("input"); start=node.AddOutputSlot("output"); node.AddProperty(new Property(typeof(System.Int32),"integer")); stateMachineGraph.AddNode(node); } if (stateMachineGraphGUI == null) { Node node=ScriptableObject.CreateInstance<Node>(); node.title="mile"; node.position=new Rect(0,0,300,200); //node.style=Styles. Slot end=node.AddInputSlot("input"); node.AddOutputSlot("output"); node.AddProperty(new Property(typeof(System.Int32),"integer")); stateMachineGraph.AddNode(node); stateMachineGraph.Connect(start,end); stateMachineGraphGUI = (GetEditor (stateMachineGraph)); } }