예제 #1
0
        private void Accelerate(out Vector2 newVelocity)
        {
            Vector2 shouldVel = transform.up * Speed;

            newVelocity = AccelerationCalculator.Vector(Rigidbody.velocity, shouldVel, Accel);

            Quaternion needRot = InDirectionRotator.Rotate(CurrentDirection);

            transform.rotation = StraightQuaternionSwitcher.Get(transform.rotation, needRot, BodyRotateSpeed * Time.fixedDeltaTime);

            IsAccelerating = false;
            IsDiagonalMove = false;
        }
예제 #2
0
 private void Decelerate(out Vector2 newVelocity)
 {
     newVelocity = AccelerationCalculator.Vector(Rigidbody.velocity, Vector2.zero, Decel);
 }