public void StartButtonOnClicked()
    {
        string[] names  = new string[numPlayers];
        Color[]  colors = new Color[numPlayers];

        for (int i = 0; i < numPlayers; i++)
        {
            string nameString  = playerInfoPanels[i].GetComponent <PlayerInfoPanel>().GetInputPlayerName();
            string colorString = playerInfoPanels[i].GetComponent <PlayerInfoPanel>().GetSelectedColorString();
            if (nameString == "" || colorString == "")
            {
                Debug.Log("Empty name or color");
                return;
            }
            names[i]  = nameString;
            colors[i] = playerColors[colorString];
        }

        LocGameManager.SetInitialMoney(int.Parse(initMoneyDropDown.captionText.text));
        LocPlayerManager.ReceivePlayersData(names, colors);

        SceneManager.LoadScene("MainGameLocal");

        Destroy(gameObject);
    }
Exemplo n.º 2
0
 private void Awake()
 {
     if (instance != null)
     {
         Debug.Log("Multiple LocPlayerController. Something went wrong");
     }
     instance = this;
 }