Пример #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;
     }
 }
Пример #2
0
        public override void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
        {
            ant.Move(0);
            if (timer < 0)
            {
                animator.SetBool("Movement", true);
            }
            else
            {
                timer -= Time.deltaTime;
            }

            if (ant.IsEntityVisible())
            {
                animator.SetBool("Rage", true);
            }
        }
Пример #3
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);
        }