public virtual void FixedUpdate()
        {
            var movement = Vector2.zero;

            if (Mobile.Health > 0 && !isParalyzed)
            {
                movement = Mobile.Move();
                if (movement.magnitude > 0)
                {
                    audioManager.Play("Walking");
                }
                else if (movement.magnitude == 0)
                {
                    audioManager.Stop("Walking");
                }
            }

            if (animationHandler != null)
            {
                lastDirectionIndex = animationHandler.SetCurrentAnimation(movement, Mobile);
            }
        }
示例#2
0
 void FixedUpdate()
 {
     mobile.Move();
 }