Transitions define when and how the state machine switch from on state to another. AnimatorTransition always originate from a StateMachine or a StateMachine entry. They do not define timing parameters.

Inheritance: AnimatorTransitionBase
Exemplo n.º 1
0
        public AnimatorTransition AddStateMachineTransition(AnimatorStateMachine sourceStateMachine, AnimatorState destinationState)
        {
            AnimatorTransition newTransition = AddStateMachineTransition(sourceStateMachine);

            newTransition.destinationState = destinationState;
            return(newTransition);
        }
Exemplo n.º 2
0
        public AnimatorTransition AddStateMachineExitTransition(AnimatorStateMachine sourceStateMachine)
        {
            AnimatorTransition newTransition = AddStateMachineTransition(sourceStateMachine);

            newTransition.isExit = true;
            return(newTransition);
        }
Exemplo n.º 3
0
 /// <summary>
 ///   <para>Utility function to remove an entry transition from the state machine.</para>
 /// </summary>
 /// <param name="transition">The transition to remove.</param>
 public bool RemoveEntryTransition(AnimatorTransition transition)
 {
     // ISSUE: object of a compiler-generated type is created
     // ISSUE: variable of a compiler-generated type
     AnimatorStateMachine.\u003CRemoveEntryTransition\u003Ec__AnonStorey19 transitionCAnonStorey19 = new AnimatorStateMachine.\u003CRemoveEntryTransition\u003Ec__AnonStorey19();
     // ISSUE: reference to a compiler-generated field
     transitionCAnonStorey19.transition = transition;
     // ISSUE: reference to a compiler-generated method
     if (!new List <AnimatorTransition>((IEnumerable <AnimatorTransition>) this.entryTransitions).Any <AnimatorTransition>(new Func <AnimatorTransition, bool>(transitionCAnonStorey19.\u003C\u003Em__21)))
     {
         return(false);
     }
     this.undoHandler.DoUndo((UnityEngine.Object) this, "Entry Transition Removed");
     AnimatorTransition[] entryTransitions = this.entryTransitions;
     // ISSUE: reference to a compiler-generated field
     ArrayUtility.Remove <AnimatorTransition>(ref entryTransitions, transitionCAnonStorey19.transition);
     this.entryTransitions = entryTransitions;
     // ISSUE: reference to a compiler-generated field
     if (MecanimUtilities.AreSameAsset((UnityEngine.Object) this, (UnityEngine.Object)transitionCAnonStorey19.transition))
     {
         // ISSUE: reference to a compiler-generated field
         Undo.DestroyObjectImmediate((UnityEngine.Object)transitionCAnonStorey19.transition);
     }
     return(true);
 }
Exemplo n.º 4
0
        public AnimatorTransition AddEntryTransition(AnimatorStateMachine destinationStateMachine)
        {
            AnimatorTransition animatorTransition = this.AddEntryTransition();

            animatorTransition.destinationStateMachine = destinationStateMachine;
            return(animatorTransition);
        }
Exemplo n.º 5
0
        public AnimatorTransition AddEntryTransition(AnimatorState destinationState)
        {
            AnimatorTransition transition = this.AddEntryTransition();

            transition.destinationState = destinationState;
            return(transition);
        }
Exemplo n.º 6
0
        public AnimatorTransition AddStateMachineTransition(AnimatorStateMachine sourceStateMachine, AnimatorState destinationState)
        {
            AnimatorTransition animatorTransition = this.AddStateMachineTransition(sourceStateMachine);

            animatorTransition.destinationState = destinationState;
            return(animatorTransition);
        }
Exemplo n.º 7
0
        public AnimatorTransition AddStateMachineExitTransition(AnimatorStateMachine sourceStateMachine)
        {
            AnimatorTransition animatorTransition = this.AddStateMachineTransition(sourceStateMachine);

            animatorTransition.isExit = true;
            return(animatorTransition);
        }
Exemplo n.º 8
0
        public AnimatorTransition AddEntryTransition(AnimatorStateMachine destinationStateMachine)
        {
            AnimatorTransition newTransition = AddEntryTransition();

            newTransition.destinationStateMachine = destinationStateMachine;
            return(newTransition);
        }
Exemplo n.º 9
0
        public AnimatorTransition AddStateMachineTransition(AnimatorStateMachine sourceStateMachine)
        {
            AnimatorTransition newTransition = new AnimatorTransition();

            AddStateMachineTransition(sourceStateMachine, newTransition);
            return(newTransition);
        }
Exemplo n.º 10
0
        private AnimatorTransition AddEntryTransition()
        {
            this.undoHandler.DoUndo(this, "Entry Transition Added");
            AnimatorTransition[] entryTransitions   = this.entryTransitions;
            AnimatorTransition   animatorTransition = new AnimatorTransition();

            if (AssetDatabase.GetAssetPath(this) != "")
            {
                AssetDatabase.AddObjectToAsset(animatorTransition, AssetDatabase.GetAssetPath(this));
            }
            animatorTransition.hideFlags = HideFlags.HideInHierarchy;
            ArrayUtility.Add <AnimatorTransition>(ref entryTransitions, animatorTransition);
            this.entryTransitions = entryTransitions;
            return(animatorTransition);
        }
Exemplo n.º 11
0
        private AnimatorTransition AddEntryTransition()
        {
            this.undoHandler.DoUndo(this, "Entry Transition Added");
            AnimatorTransition[] entryTransitions = this.entryTransitions;
            AnimatorTransition   objectToAdd      = new AnimatorTransition();

            if (AssetDatabase.GetAssetPath(this) != string.Empty)
            {
                AssetDatabase.AddObjectToAsset(objectToAdd, AssetDatabase.GetAssetPath(this));
            }
            objectToAdd.hideFlags = HideFlags.HideInHierarchy;
            ArrayUtility.Add <AnimatorTransition>(ref entryTransitions, objectToAdd);
            this.entryTransitions = entryTransitions;
            return(objectToAdd);
        }
Exemplo n.º 12
0
 public bool RemoveEntryTransition(AnimatorTransition transition)
 {
     if (new List <AnimatorTransition>(this.entryTransitions).Any((AnimatorTransition t) => t == transition))
     {
         this.undoHandler.DoUndo(this, "Entry Transition Removed");
         AnimatorTransition[] entryTransitions = this.entryTransitions;
         ArrayUtility.Remove <AnimatorTransition>(ref entryTransitions, transition);
         this.entryTransitions = entryTransitions;
         if (MecanimUtilities.AreSameAsset(this, transition))
         {
             Undo.DestroyObjectImmediate(transition);
         }
         return(true);
     }
     return(false);
 }
Exemplo n.º 13
0
        private AnimatorTransition AddEntryTransition()
        {
            undoHandler.DoUndo(this, "Entry Transition Added");
            AnimatorTransition[] transitionsVector = entryTransitions;
            AnimatorTransition   newTransition     = new AnimatorTransition();

            if (AssetDatabase.GetAssetPath(this) != "")
            {
                AssetDatabase.AddObjectToAsset(newTransition, AssetDatabase.GetAssetPath(this));
            }

            newTransition.hideFlags = HideFlags.HideInHierarchy;
            ArrayUtility.Add(ref transitionsVector, newTransition);
            entryTransitions = transitionsVector;

            return(newTransition);
        }
Exemplo n.º 14
0
        public bool RemoveEntryTransition(AnimatorTransition transition)
        {
            if ((new List <AnimatorTransition>(entryTransitions)).Any(t => t == transition))
            {
                undoHandler.DoUndo(this, "Entry Transition Removed");
                AnimatorTransition[] transitionsVector = entryTransitions;
                ArrayUtility.Remove(ref transitionsVector, transition);
                entryTransitions = transitionsVector;

                if (MecanimUtilities.AreSameAsset(this, transition))
                {
                    Undo.DestroyObjectImmediate(transition);
                }

                return(true);
            }

            return(false);
        }
Exemplo n.º 15
0
        /// <summary>
        ///   <para>Utility function to add an outgoing transition from the source state machine to the destination.</para>
        /// </summary>
        /// <param name="sourceStateMachine">The source state machine.</param>
        /// <param name="destinationStateMachine">The destination state machine.</param>
        /// <param name="destinationState">The destination state.</param>
        /// <returns>
        ///   <para>The Animations.AnimatorTransition transition that was created.</para>
        /// </returns>
        public AnimatorTransition AddStateMachineTransition(AnimatorStateMachine sourceStateMachine, AnimatorStateMachine destinationStateMachine)
        {
            this.undoHandler.DoUndo((UnityEngine.Object) this, "StateMachine Transition Added");
            AnimatorTransition[] machineTransitions = this.GetStateMachineTransitions(sourceStateMachine);
            AnimatorTransition   animatorTransition = new AnimatorTransition();

            if ((bool)((UnityEngine.Object)destinationStateMachine))
            {
                animatorTransition.destinationStateMachine = destinationStateMachine;
            }
            if (AssetDatabase.GetAssetPath((UnityEngine.Object) this) != string.Empty)
            {
                AssetDatabase.AddObjectToAsset((UnityEngine.Object)animatorTransition, AssetDatabase.GetAssetPath((UnityEngine.Object) this));
            }
            animatorTransition.hideFlags = HideFlags.HideInHierarchy;
            ArrayUtility.Add <AnimatorTransition>(ref machineTransitions, animatorTransition);
            this.SetStateMachineTransitions(sourceStateMachine, machineTransitions);
            return(animatorTransition);
        }
Exemplo n.º 16
0
        public AnimatorTransition AddStateMachineTransition(AnimatorStateMachine sourceStateMachine, AnimatorStateMachine destinationStateMachine)
        {
            this.undoHandler.DoUndo(this, "StateMachine Transition Added");
            AnimatorTransition[] stateMachineTransitions = this.GetStateMachineTransitions(sourceStateMachine);
            AnimatorTransition   animatorTransition      = new AnimatorTransition();

            if (destinationStateMachine)
            {
                animatorTransition.destinationStateMachine = destinationStateMachine;
            }
            if (AssetDatabase.GetAssetPath(this) != "")
            {
                AssetDatabase.AddObjectToAsset(animatorTransition, AssetDatabase.GetAssetPath(this));
            }
            animatorTransition.hideFlags = HideFlags.HideInHierarchy;
            ArrayUtility.Add <AnimatorTransition>(ref stateMachineTransitions, animatorTransition);
            this.SetStateMachineTransitions(sourceStateMachine, stateMachineTransitions);
            return(animatorTransition);
        }
Exemplo n.º 17
0
        public AnimatorTransition AddStateMachineTransition(AnimatorStateMachine sourceStateMachine, AnimatorStateMachine destinationStateMachine)
        {
            this.undoHandler.DoUndo(this, "StateMachine Transition Added");
            AnimatorTransition[] stateMachineTransitions = this.GetStateMachineTransitions(sourceStateMachine);
            AnimatorTransition   objectToAdd             = new AnimatorTransition();

            if (destinationStateMachine != null)
            {
                objectToAdd.destinationStateMachine = destinationStateMachine;
            }
            if (AssetDatabase.GetAssetPath(this) != string.Empty)
            {
                AssetDatabase.AddObjectToAsset(objectToAdd, AssetDatabase.GetAssetPath(this));
            }
            objectToAdd.hideFlags = HideFlags.HideInHierarchy;
            ArrayUtility.Add <AnimatorTransition>(ref stateMachineTransitions, objectToAdd);
            this.SetStateMachineTransitions(sourceStateMachine, stateMachineTransitions);
            return(objectToAdd);
        }
Exemplo n.º 18
0
        public AnimatorTransition AddStateMachineTransition(AnimatorStateMachine sourceStateMachine, AnimatorStateMachine destinationStateMachine)
        {
            undoHandler.DoUndo(this, "StateMachine Transition Added");

            AnimatorTransition[] transitionsVector = GetStateMachineTransitions(sourceStateMachine);
            AnimatorTransition   newTransition     = new AnimatorTransition();

            if (destinationStateMachine)
            {
                newTransition.destinationStateMachine = destinationStateMachine;
            }

            if (AssetDatabase.GetAssetPath(this) != "")
            {
                AssetDatabase.AddObjectToAsset(newTransition, AssetDatabase.GetAssetPath(this));
            }

            newTransition.hideFlags = HideFlags.HideInHierarchy;
            ArrayUtility.Add(ref transitionsVector, newTransition);
            SetStateMachineTransitions(sourceStateMachine, transitionsVector);

            return(newTransition);
        }
Exemplo n.º 19
0
        public bool RemoveStateMachineTransition(AnimatorStateMachine sourceStateMachine, AnimatorTransition transition)
        {
            this.undoHandler.DoUndo(this, "StateMachine Transition Removed");
            AnimatorTransition[] stateMachineTransitions = this.GetStateMachineTransitions(sourceStateMachine);
            int num = stateMachineTransitions.Length;

            ArrayUtility.Remove <AnimatorTransition>(ref stateMachineTransitions, transition);
            this.SetStateMachineTransitions(sourceStateMachine, stateMachineTransitions);
            if (MecanimUtilities.AreSameAsset(this, transition))
            {
                Undo.DestroyObjectImmediate(transition);
            }
            return(num != stateMachineTransitions.Length);
        }
 public void clear()
 {
     m_condList.Clear();
     m_animatorTransition = null;
 }
Exemplo n.º 21
0
        /// <summary>
        ///   <para>Utility function to remove an outgoing transition from source state machine.</para>
        /// </summary>
        /// <param name="transition">The transition to remove.</param>
        /// <param name="sourceStateMachine">The source state machine.</param>
        public bool RemoveStateMachineTransition(AnimatorStateMachine sourceStateMachine, AnimatorTransition transition)
        {
            this.undoHandler.DoUndo((UnityEngine.Object) this, "StateMachine Transition Removed");
            AnimatorTransition[] machineTransitions = this.GetStateMachineTransitions(sourceStateMachine);
            int length = machineTransitions.Length;

            ArrayUtility.Remove <AnimatorTransition>(ref machineTransitions, transition);
            this.SetStateMachineTransitions(sourceStateMachine, machineTransitions);
            if (MecanimUtilities.AreSameAsset((UnityEngine.Object) this, (UnityEngine.Object)transition))
            {
                Undo.DestroyObjectImmediate((UnityEngine.Object)transition);
            }
            return(length != machineTransitions.Length);
        }
Exemplo n.º 22
0
 public AnimatorTransition()
 {
     AnimatorTransition.Internal_CreateAnimatorTransition(this);
 }
Exemplo n.º 23
0
 private static extern void Internal_CreateAnimatorTransition([Writable] AnimatorTransition mono);
Exemplo n.º 24
0
        internal void AddStateMachineTransition(AnimatorStateMachine sourceStateMachine, AnimatorTransition transition)
        {
            undoHandler.DoUndo(this, "StateMachine Transition Added");

            AnimatorTransition[] transitionsVector = GetStateMachineTransitions(sourceStateMachine);

            if (AssetDatabase.GetAssetPath(this) != "")
            {
                AssetDatabase.AddObjectToAsset(transition, AssetDatabase.GetAssetPath(this));
            }

            undoHandler.DoUndoCreated(transition, "StateMachine Transition Created");

            transition.hideFlags = HideFlags.HideInHierarchy;
            ArrayUtility.Add(ref transitionsVector, transition);
            SetStateMachineTransitions(sourceStateMachine, transitionsVector);
        }
Exemplo n.º 25
0
        public bool RemoveStateMachineTransition(AnimatorStateMachine sourceStateMachine, AnimatorTransition transition)
        {
            undoHandler.DoUndo(this, "StateMachine Transition Removed");

            AnimatorTransition[] transitionsVector = GetStateMachineTransitions(sourceStateMachine);
            int baseSize = transitionsVector.Length;

            ArrayUtility.Remove(ref transitionsVector, transition);
            SetStateMachineTransitions(sourceStateMachine, transitionsVector);

            if (MecanimUtilities.AreSameAsset(this, transition))
            {
                Undo.DestroyObjectImmediate(transition);
            }

            return(baseSize != transitionsVector.Length);
        }
Exemplo n.º 26
0
		private static extern void Internal_Create(AnimatorTransition mono);
Exemplo n.º 27
0
 private static extern void Internal_Create(AnimatorTransition mono);