예제 #1
0
 public override void Connect(Node toNode, Edge edge)
 {
     if (toNode is StateNode)
     {
         this.graphGUI.stateMachineGraph.activeStateMachine.AddStateMachineTransition(this.stateMachine, (toNode as StateNode).state);
         this.graphGUI.stateMachineGraph.RebuildGraph();
     }
     else if (toNode is StateMachineNode)
     {
         Node.GenericMenuForStateMachineNode(toNode as StateMachineNode, true, delegate(object data)
         {
             if (data is AnimatorState)
             {
                 this.graphGUI.stateMachineGraph.activeStateMachine.AddStateMachineTransition(this.stateMachine, data as AnimatorState);
             }
             else
             {
                 this.graphGUI.stateMachineGraph.activeStateMachine.AddStateMachineTransition(this.stateMachine, data as AnimatorStateMachine);
             }
             this.graphGUI.stateMachineGraph.RebuildGraph();
         });
     }
     else if (toNode is ExitNode)
     {
         this.graphGUI.stateMachineGraph.activeStateMachine.AddStateMachineExitTransition(this.stateMachine);
         this.graphGUI.stateMachineGraph.RebuildGraph();
     }
 }
예제 #2
0
 public override void Connect(Node toNode, Edge edge)
 {
     if (toNode is StateNode)
     {
         this.graphGUI.stateMachineGraph.rootStateMachine.AddAnyStateTransition((toNode as StateNode).state);
         this.graphGUI.stateMachineGraph.RebuildGraph();
     }
     if (toNode is StateMachineNode)
     {
         StateMachineNode stateMachineNode = toNode as StateMachineNode;
         if (stateMachineNode.stateMachine != this.graphGUI.parentStateMachine)
         {
             Node.GenericMenuForStateMachineNode(toNode as StateMachineNode, true, delegate(object data)
             {
                 if (data is AnimatorState)
                 {
                     this.graphGUI.stateMachineGraph.rootStateMachine.AddAnyStateTransition(data as AnimatorState);
                 }
                 else if (data is AnimatorStateMachine)
                 {
                     this.graphGUI.stateMachineGraph.rootStateMachine.AddAnyStateTransition(data as AnimatorStateMachine);
                 }
                 this.graphGUI.stateMachineGraph.RebuildGraph();
             });
         }
     }
     if (toNode is EntryNode)
     {
         this.graphGUI.stateMachineGraph.rootStateMachine.AddAnyStateTransition(this.graphGUI.activeStateMachine);
     }
 }
예제 #3
0
 public override void Connect(Node toNode, Edge edge)
 {
     if (toNode is StateNode)
     {
         if (this.draggingDefaultState)
         {
             this.m_StateMachine.defaultState = (toNode as StateNode).state;
         }
         else
         {
             this.m_StateMachine.AddEntryTransition((toNode as StateNode).state);
         }
         this.graphGUI.stateMachineGraph.RebuildGraph();
     }
     else if (toNode is StateMachineNode)
     {
         bool isDragginDefaultState = this.draggingDefaultState;
         Node.GenericMenuForStateMachineNode(toNode as StateMachineNode, !this.draggingDefaultState, delegate(object data)
         {
             if (data is AnimatorState)
             {
                 if (isDragginDefaultState)
                 {
                     this.m_StateMachine.defaultState = (data as AnimatorState);
                 }
                 else
                 {
                     this.m_StateMachine.AddEntryTransition(data as AnimatorState);
                 }
             }
             else if (data is AnimatorStateMachine)
             {
                 this.m_StateMachine.AddEntryTransition(data as AnimatorStateMachine);
             }
             this.graphGUI.stateMachineGraph.RebuildGraph();
         });
     }
     this.draggingDefaultState = false;
 }