Esempio n. 1
0
 public override void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     if (ant.IsEntityVisible())
     {
         ant.Reaction();
     }
     if (!ant.IsEntityVisible() && timer < 0 || ant.IsHitWall())
     {
         animator.SetBool("Rage", false);
     }
     else
     {
         timer -= Time.deltaTime;
     }
 }
Esempio n. 2
0
        public override void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
        {
            if (timer < 0)
            {
                ChangeDirection(animator);
            }
            else
            {
                timer -= Time.deltaTime;
            }

            if (ant.IsHitWall())
            {
                ChangeDirection(animator);
            }

            if (ant.IsEntityVisible())
            {
                animator.SetBool("Rage", true);
            }

            ant.Move(movement * Time.deltaTime);
        }