Esempio n. 1
0
 void UpdatePosition(NodeOutput output, Event e)
 {
     if (output == null || this is RootBehaviorNode)
     {
         return;
     }
     foreach (var n in output.nodes)
     {
         UpdatePosition(n.output, e);
         n.nodeRect.position += e.delta;
     }
 }
Esempio n. 2
0
        public int behaviorIndex;                         // the current index

        /// <summary>
        /// Init the Node
        /// </summary>
        /// <param name="parentGraph"></param>
        public virtual void InitNode(ChainGraph parentGraph)
        {
            output = new NodeOutput();
            input  = new NodeInput();

            inPortSkin  = new GUIStyle("Button");
            outPortSkin = new GUIStyle("Button");
            inPortSkin.overflow.bottom = 10;
            outPortSkin.overflow.top   = 10;

            nodeType = NodeType.ChainBehaviorNode;
            nodeRect = new Rect(10, 10, 100, 100);
        }
Esempio n. 3
0
        /// <summary>
        /// Init the Node
        /// </summary>
        /// <param name="parentGraph"></param>
        public override void InitNode(ChainGraph parentGraph)
        {
            output   = new NodeOutput();
            behavior = parentGraph.model.GetBehavior("Default");
            id       = 0;
            priority = 0;

            outPortSkin = new GUIStyle("Button");
            outPortSkin.overflow.top = 10;

            nodeType = NodeType.RootBehaviorNode;
            nodeRect = new Rect(10, 10, 100, 100);
        }