Exemple #1
0
    /// <summary>
    /// Captures event inputs like pausing the game or opening selection screen
    /// </summary>
    void EventInputs()
    {
        //Pause/ OK button
        if (Input.GetButtonDown("Start") || Input.GetKeyDown(KeyCode.Return))
        {
            if (gamestate.CurrentBattleState == BattleState.battle && Time.timeScale > 0)
            {
                Debug.Log("Input captured. Start button, pausing game");
                gamestate.CurrentBattleState = BattleState.pause;
            }

            if (gamestate.CurrentBattleState == BattleState.pause && Time.timeScale == 0)
            {
                Debug.Log("Input captured. Start button, unpausing game");
                gamestate.CurrentBattleState = BattleState.battle;
            }

            if (gamestate.CurrentBattleState == BattleState.selectionScreen)
            {
                Debug.Log("Input captured. Setting cursor on OK button");
                gamestate.SetSelectionScreenCursorOK();
            }

            if (gamestate.CurrentBattleState == BattleState.restart)
            {
                gamestate.ReloadScene();
            }
        }

        //Return
        if (Input.GetButtonDown("Back") || Input.GetKeyDown(KeyCode.Escape))
        {
            if (gamestate.CurrentBattleState == BattleState.battle && Time.timeScale > 0)
            {
                Debug.Log("Input captured. Back button, pausing game");
                gamestate.ChangeBattleState(BattleState.pause);
            }

            if (gamestate.CurrentBattleState == BattleState.pause && Time.timeScale == 0)
            {
                Debug.Log("Input captured. Back button, unpausing game");
                gamestate.ChangeBattleState(BattleState.battle);
            }
        }

        //
        if (Input.GetButtonDown("LB") || Input.GetKeyDown(KeyCode.Tab))
        {
            if (gamestate.CurrentBattleState == BattleState.selectionScreen)
            {
                Debug.Log("Input captured. Showing info");
                gamestate.DisplayChipInformation();
            }

            if (gamestate.CurrentBattleState == BattleState.battle)
            {
                Debug.Log("Input captured. Skill 1 fired");

                /*Debug.Log("Input captured. Custom bar full, entering selection screen");
                 * characterControl.FlushChips();
                 * characterControl.setChip("GrenadeChip", 1);
                 * characterControl.setChip("GrenadeChip", 2);
                 * characterControl.setChip("Cannon", 3);
                 * characterControl.setChip("Cannon", 4);*/
            }
        }

        //
        if (Input.GetButtonDown("RB") || Input.GetKeyDown(KeyCode.Space))
        {
            if (gamestate.CurrentBattleState == BattleState.selectionScreen)
            {
                Debug.Log("Input captured. Shuffling folder");
            }

            if (gamestate.CurrentBattleState == BattleState.battle)
            {
                Debug.Log("Input captured. Skill 2 fired");
            }
        }
    }