Пример #1
0
    //Method used to check for input from the player
    private void ProcessInput()
    {
        if (GameManager.instance.CurrentState == gameState.GAMEPLAY)
        {
            if (InputData.ActionPressed("pause"))
            {
                UIManager.instance.ForwardCanvas(pauseCanvas);
                GameManager.instance.CurrentState = gameState.PAUSE;

                GetComponent <FirstPersonController>().enabled = false;
                GetComponent <FirstPersonController>().MouseLook.SetCursorLock(false);
            }
            //Toggling our shapeshift
            if (InputData.ActionPressed("shapeshift"))
            {
                abilityData.ToggleShapeShiftState();
            }
            //Toggling Nightvision
            if (InputData.ActionPressed("toggleNightVision"))
            {
                abilityData.ToggleNightVision();
            }

            if (InputData.ActionPressed("debugEnableVignette"))
            {
                abilityData.ToggleVignette();
            }
        }
        else if (GameManager.instance.CurrentState == gameState.PAUSE)
        {
            if (InputData.ActionPressed("pause"))
            {
                UIManager.instance.BackButton();
                GameManager.instance.CurrentState = gameState.GAMEPLAY;

                GetComponent <FirstPersonController>().enabled = true;
                GetComponent <FirstPersonController>().MouseLook.SetCursorLock(true);
            }
        }
    }