Пример #1
0
    private void Update()
    {
        if (pauseMenu.paused == true)
        {
            return;
        }
        if (!m_Jump)
        {
            // Read the jump input in Update so button presses aren't missed.
            m_Jump = CrossPlatformInputManager.GetButtonDown("Jump");
        }
        // Read the mouse input in Update so button presses aren't missed.
        bool m_ClickFire = CrossPlatformInputManager.GetButtonDown("Fire1");
        bool m_AutoFire  = CrossPlatformInputManager.GetButton("Fire1");

        m_Character.Fire(m_ClickFire, m_AutoFire);
        bool m_Reload = CrossPlatformInputManager.GetButton("Reload");

        m_Character.Reload(m_Reload);
        float switchGun = CrossPlatformInputManager.GetAxis("Switch");

        if (switchGun != 0 && AxisInUse == false)
        {
            player.Switch(switchGun);
            AxisInUse = true;
        }
        if (switchGun == 0)
        {
            AxisInUse = false;
        }
    }