public void StartGame() { playerPanels = FindObjectsOfType <PlayerPanel> ().ToArray(); // find panels with an assigned controller // set players attached to these panels for (int i = 0; i < playerPanels.Length; i++) { PlayerPanel playerPanel = playerPanels [i]; PlayerController player = playerPanel.player; //Debug.Log ("player panel value : " + playerPanel.player); if (playerPanel.HasControllerAssigned() && !this.players.Contains(player)) { this.players.Add(player); } } // Listen scenes loaded SceneManager.sceneLoaded += OnSceneLoaded; // load the first scene // TODO : change the first scene name LoadScene("Arene2"); }