public Player(BlokusColor color, string name = "Undefined player") { Name = name; Color = color; IsBlocked = false; Pieces = new List <Piece>() { new Piece_1(), new Piece_2(), new Piece_3(), new Piece_Crooked_3(), new Piece_F(), new Piece_L(), new Piece_L_Short(), new Piece_Line(), new Piece_Line_Short(), new Piece_N(), new Piece_P(), new Piece_Square(), new Piece_T(), new Piece_T_Short(), new Piece_U(), new Piece_V(), new Piece_W(), new Piece_X(), new Piece_Y(), new Piece_Z(), new Piece_Z_Short(), }; }
/// <summary> /// Switch the scene to start the game /// </summary> private void StartGameOnClick() { List <Player> playersList = new List <Player>(); foreach (GameObject playerField in ListPlayerFields) { TextMeshProUGUI playerNameField = playerField.GetComponentInChildren <TextMeshProUGUI>(); TMP_Dropdown dropdown = playerField.GetComponentInChildren <TMP_Dropdown>(); BlokusColor color = (BlokusColor)(dropdown.value - DropdownColor.VALUE_CORRECTION); string playerName = (playerNameField.text != "") ? playerNameField.text : "Player " + color; playersList.Add(new Player(color, playerName)); } PlayerList.Players = playersList; SceneManager.LoadScene(GAME_SCENE_NAME); }