/// <summary>When a Tag Changes apply this modifications</summary> public void AnimationTagEnter(int animatorTagHash) { if (MainTagHash == animatorTagHash) { General.Modify(animal); animal.State_SetStatus(Int_ID.Available); //Reset all the Status when the animal enters the main State Animation IsPending = false; if (IsActiveState) { EnterCoreAnimation(); return; //Do not search for Active Tags } } TagModifier ActiveTag = TagModifiers.Find(tag => tag.TagHash == animatorTagHash); if (ActiveTag != null) { IsPending = false; ActiveTag.modifier.Modify(animal); EnterTagAnimation(); CheckPendingExit(); } }
// bool HasEnterState; /// <summary>When a Tag Changes apply this modifications</summary> public bool AnimationTagEnter(int animatorTagHash) { if (MainTagHash == animatorTagHash) { General.Modify(animal); IsPending = false; CheckPendingExit(); } TagModifier ActiveTag = TagModifiers.Find(tag => tag.TagHash == animatorTagHash); if (ActiveTag != null) { ActiveTag.modifier.Modify(animal); IsPending = false; CheckPendingExit(); } if (IsActiveState /* && !HasEnterState*/) { //HasEnterState = true; AnimationStateEnter(); } return(IsPending); }
/// <summary>When a Tag Changes apply this modifications</summary> public bool AnimationTagEnter(int animatorTagHash) { IsPending = true; if (MainTagHash == animatorTagHash) { General.Modify(animal); animal.SetIntID(0); IsPending = false; } TagModifier ActiveTag = TagModifiers.Find(tag => tag.TagHash == animatorTagHash); if (ActiveTag != null) { ActiveTag.modifier.Modify(animal); IsPending = false; } if (ActiveState) { AnimationStateEnter(); } return(IsPending); }
override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { ExitModifier.Modify(animal); }
override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { animal = animator.GetComponent <MAnimal>(); EnterModifier.Modify(animal); }