void AddPlayersOnPanel(ArrayList players, GameObject panel) { PlayerInfoPanelController panelController = null; GameObject newPanel = null; foreach (var player in players) { newPanel = null; panelController = null; newPanel = Instantiate <GameObject>(PlayerInfoPanelPrefab); if (newPanel != null) { newPanel.transform.SetParent(panel.transform); panelController = newPanel.GetComponent <PlayerInfoPanelController>(); if (panelController != null) { panelController.UpdatePlayerInfo(player as PlayerInfo); } } } }
void Start() { Instance = this; ActivePanel = null; }