Exemplo n.º 1
0
 public void SetMovementToZero()
 {
     Params.Movement = 0;
     Unit.UnitAnimator.Params.IsDecelerating = false;
     Unit.UnitAnimator.Params.IsAccelerating = false;
     OnReachZeroVelocity.Invoke();
 }
Exemplo n.º 2
0
        public void Decelerate()
        {
            var movementValue = Params.Movement;
            var minVelocity   = Unit_Animator_Params.MIN_VELOCITY;

            Params.Movement = Mathf.Max(minVelocity, movementValue - MoveAcceleration);
            OnDecelerating.Invoke();

            if (movementValue != minVelocity && Params.Movement == minVelocity)
            {
                OnReachZeroVelocity.Invoke();
            }
        }