Пример #1
0
    void FixedUpdate()
    {
        float horizontal = PlatformInputManager.horizontalInput;
        float vertical   = PlatformInputManager.verticalInput;

        if (PlatformInputManager.rotateInput && !(horizontal == 0 && vertical == 0))
        {
            if (!m_controller_player.isJump)
            {
                m_controller_player.changeSpeedToRun();
                StartCoroutine(waitAndFixedSpeedMove(0.8F));
            }

            Rotate();
        }
        else
        {
            if (!m_controller_player.isJump)
            {
                if (horizontal == 0 && vertical == 0)
                {
                    State();
                }
                else
                {
                    Move();
                }
            }
            else
            {
                Jump();
            }
        }
    }