コード例 #1
0
    void HandleCharacterSelection()
    {
        ConfirmCharacterSelect characterManager = GameObject.Find("CharacterManager").GetComponent <ConfirmCharacterSelect>();

        foreach (int playerNumber in characterManager.GetActivePlayers())
        {
            if (Input.GetButtonDown("Start_P" + playerNumber) || Input.GetButtonDown("Throw_P" + playerNumber))
            {
                if (GameObject.Find("CharacterManager").GetComponent <ConfirmCharacterSelect>().AllPlayersReady())
                {
                    Instance.sceneToLoad = "Game";
                    SceneForward();
                }
            }
        }
        if (Input.GetButtonDown("Cancel"))
        {
            if (GameObject.Find("CharacterManager").GetComponent <ConfirmCharacterSelect>().NoActivePlayers())
            {
                Instance.sceneToLoad = "Start";
                SceneBackward();
            }
        }
        if (Input.GetButtonDown("Escape"))
        {
            Instance.sceneToLoad = "Start";
            SceneBackward();
        }
    }