示例#1
0
    public void JoinGame()
    {
        AudioManager.Play("Joined");
        joinScreen.SetActive(false);
        playerNumText.SetActive(true);
        Settings.NumOfPlayers = Settings.NumOfPlayers + 1;
        Debug.Log("numofplayers = " + Settings.NumOfPlayers);
        GotoMenuHelper(newGameOrLoadMenu);
        previousMenu = joinScreen;   //After player has joined, they will only be able to back up to "NewOrLoad" menu, going back anymore will cause the game to go back to MainMenu
        //newGameOrLoadMenu.SetActive(true);
        //currentMenu = newGameOrLoadMenu;
        //currentButton = 0;

        if (!MenuInputSelector.AllPlayersReady())
        {
            StartText.SetActive(false);
            SelectCharText.SetActive(true);
        }
    }
示例#2
0
    public void GotoLevel()
    {
        //playerReadyScreen.transform.parent.parent.GetComponent<CSSTopMenuScript>().setPlayerReady(playerNum);

        //MenuInputSelector.PlayersReady[playerNum - 1] = true;

        //this.GetComponent<Image>().enabled = true;   //highlight "Ready" button

        if (MenuInputSelector.PlayersReady[playerNum - 1] == false)
        {
            AudioManager.Play("StartLevel");
            MenuInputSelector.PlayersReady[playerNum - 1] = true;
            GetComponent <Image>().enabled = true;
            if (MenuInputSelector.AllPlayersReady() == true)
            {
                Debug.Log("Got to ALLPLAYERSREADY check");
                StartText.SetActive(true);
                SelectCharText.SetActive(false);
            }
        }
        else
        {
            if (MenuInputSelector.AllPlayersReady())
            {
                //AudioManager.Play("StartLevel");
                //SceneManager.LoadScene("SampleScene");
                SceneManager.LoadScene("LoadingScreenScene");
                //SceneManager.LoadScene("SampleScene2");
            }
            else
            {
                AudioManager.Play("Back"); //Wait
                Debug.Log("Not all players are ready yet!!");
            }
        }
    }