예제 #1
0
    void UpdateUpsideDownRoll()
    {
        float targetUpsideDownRoll = 0f;

        if (ShipMovement.IsMovementUpsideDown() == true)
        {
            targetUpsideDownRoll = 180f;
        }

        //When dealing with movement, I always try to use Lerp rather than MoveTowards, it creates a more organic feel
        //whereas MoveTowards feels more robotic, since it is strictly linear
        m_UpsideDownRoll = Mathf.Lerp(m_UpsideDownRoll, targetUpsideDownRoll, UpsideDownRollAcceleration * Time.deltaTime);
    }