Exemple #1
0
    /// <summary>
    /// Captures card module inputs
    /// </summary>
    void CardModuleInputs()
    {
        //Chip 1
        if (Input.GetButtonDown("A") || Input.GetKeyDown(KeyCode.Q))
        {
            if (gamestate.CurrentBattleState == BattleState.battle)
            {
                Debug.Log("Input captured. Using Chip 1");
                characterControl.UseChip(1);
                gamestate.DestroyChipBattleScreen(1);
            }

            if (gamestate.CurrentBattleState == BattleState.standby)
            {
                Debug.Log("Input captured. Standing by, no chip can be used.");
            }

            if (gamestate.CurrentBattleState == BattleState.selectionScreen)
            {
                Debug.Log("Input captured. Current highlighted card assigned to Chip 1 button");
                gamestate.SetChipSelectionScreen(1);
            }

            if (gamestate.CurrentBattleState == BattleState.results)
            {
                Debug.Log("Input captured. Result screen, skiping results");
            }

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

        //Chip 2
        if (Input.GetButtonDown("B") || Input.GetKeyDown(KeyCode.W))
        {
            if (gamestate.CurrentBattleState == BattleState.battle)
            {
                Debug.Log("Input captured. Using Chip 2");
                characterControl.UseChip(2);
                gamestate.DestroyChipBattleScreen(2);
            }

            if (gamestate.CurrentBattleState == BattleState.selectionScreen)
            {
                Debug.Log("Input captured. Current highlighted card assigned to Chip 1 button");
                gamestate.SetChipSelectionScreen(2);
            }

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

        //Chip 3
        if (Input.GetButtonDown("X") || Input.GetKeyDown(KeyCode.E))
        {
            if (gamestate.CurrentBattleState == BattleState.battle)
            {
                Debug.Log("Input captured. Using Chip 3");
                characterControl.UseChip(3);
                gamestate.DestroyChipBattleScreen(3);
            }

            if (gamestate.CurrentBattleState == BattleState.selectionScreen)
            {
                Debug.Log("Input captured. Current highlighted card assigned to Chip 1 button");
                gamestate.SetChipSelectionScreen(3);
            }

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

        //Chip 4
        if (Input.GetButtonDown("Y") || Input.GetKeyDown(KeyCode.R))
        {
            if (gamestate.CurrentBattleState == BattleState.battle)
            {
                Debug.Log("Input captured. Using Chip 4");
                characterControl.UseChip(4);
                gamestate.DestroyChipBattleScreen(4);
            }

            if (gamestate.CurrentBattleState == BattleState.selectionScreen)
            {
                Debug.Log("Input captured. Current highlighted card assigned to Chip 1 button");
                gamestate.SetChipSelectionScreen(4);
            }

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

        //Fixed 1

        /*if (Mathf.Round(Input.GetAxis("LT")) == 1.0f || Input.GetKeyDown(KeyCode.LeftShift))
         * {
         *  Debug.Log("Input captured. Using Fixed 1");
         * }
         *
         * //Fixed 2
         * if (Mathf.Round(Input.GetAxis("RT")) == -1.0f || Input.GetKeyDown(KeyCode.RightShift))
         * {
         *  Debug.Log("Input captured. Using Fixed 2");
         * }*/
    }