Example #1
0
        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));
            }
        }
Example #2
0
        GraphGUIEx GetEditor(Graph graph)
        {
            GraphGUIEx graphGUI = ScriptableObject.CreateInstance <GraphGUIEx>();

            graphGUI.graph     = graph;
            graphGUI.hideFlags = HideFlags.HideAndDontSave;
            return(graphGUI);
        }
Example #3
0
        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));
            }
        }