Base class for animator transitions. Transitions define when and how the state machine switches from one state to another.

Inheritance: Object
 private void BuildDestinationStatesRecursive(AnimatorTransitionBase transition, AnimatorStateMachine rootStateMachine, AnimatorStateMachine currentStateMachine)
 {
     if (transition.destinationState != null)
     {
         this.m_DstStates.Add(transition.destinationState);
     }
     else if (transition.isExit)
     {
         AnimatorStateMachine machine = rootStateMachine.FindParent(currentStateMachine);
         if (machine != null)
         {
             AnimatorTransition[] stateMachineTransitions = machine.GetStateMachineTransitions(currentStateMachine);
             foreach (AnimatorTransition transition2 in stateMachineTransitions)
             {
                 this.BuildDestinationStatesRecursive(transition2, rootStateMachine, machine);
             }
         }
     }
     else if ((transition.destinationStateMachine != null) && !this.m_DstStateMachines.Contains(transition.destinationStateMachine))
     {
         this.m_DstStateMachines.Add(transition.destinationStateMachine);
         if (transition.destinationStateMachine.defaultState != null)
         {
             this.m_DstStates.Add(transition.destinationStateMachine.defaultState);
         }
         AnimatorTransition[] entryTransitions = transition.destinationStateMachine.entryTransitions;
         foreach (AnimatorTransition transition3 in entryTransitions)
         {
             this.BuildDestinationStatesRecursive(transition3, rootStateMachine, transition.destinationStateMachine);
         }
     }
 }
 public TransitionEditionContext(AnimatorTransitionBase aTransition, AnimatorState aSourceState, AnimatorStateMachine aSourceStateMachine, AnimatorStateMachine aOwnerStateMachine)
 {
     this.transition = aTransition;
     this.sourceState = aSourceState;
     this.sourceStateMachine = aSourceStateMachine;
     this.ownerStateMachine = aOwnerStateMachine;
     this.BuildNames();
 }
Beispiel #3
0
 public bool HasTransition(AnimatorTransitionBase transition)
 {
     foreach (TransitionEditionContext context in this.transitions)
     {
         if (context.transition == transition)
         {
             return true;
         }
     }
     return false;
 }
 protected override void SetTransitionToInspect(AnimatorTransitionBase transition)
 {
     base.SetTransitionToInspect(transition);
     if (base.m_Controller != null)
     {
         AnimatorStateMachine stateMachine = base.m_Controller.layers[base.m_LayerIndex].stateMachine;
         AnimatorState sourceState = this.GetSourceState(base.m_TransitionList.index);
         if (sourceState != null)
         {
             this.m_DstStates = new List<AnimatorState>();
             this.m_DstStateMachines = new HashSet<AnimatorStateMachine>();
             this.BuildDestinationStatesRecursive(transition, stateMachine, sourceState.FindParent(stateMachine));
         }
     }
 }