Exemplo n.º 1
0
 override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     if (!isExit && animator.GetCurrentAnimatorStateInfo(layerIndex).fullPathHash == stateInfo.fullPathHash)
     {
         if (stateInfo.normalizedTime > startTime && stateInfo.normalizedTime < endTime)
         {
             array.SetActive(index, value);
         }
         else if (stateInfo.normalizedTime >= endTime)
         {
             isExit = true;
             array.SetActive(index, activeBef);
         }
     }
 }
Exemplo n.º 2
0
 override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     array     = animator.GetComponentInParent <GameObjectArray>();
     activeBef = array.GetActive(index);
     if (animator.GetCurrentAnimatorStateInfo(layerIndex).fullPathHash == stateInfo.fullPathHash && stateInfo.normalizedTime > startTime && stateInfo.normalizedTime < endTime)
     {
         array.SetActive(index, value);
     }
     isExit = false;
 }