Пример #1
0
    private float GetVelocity()
    {
        Debug.Assert(m_playerInput != null);
        var direction = 0f;

        if (m_playerInput.GetLeftKey())
        {
            direction = -1f;
        }
        else if (m_playerInput.GetRightKey())
        {
            direction = 1f;
        }
        return(direction * GetMaxVelocity());
    }