public void updatePlayersInfo() { var players = manager.getPlayers(); for (int i = 0; i < players.Count; i++) { InfoHandler infoHandler = playerObjects[i].GetComponent <InfoHandler>(); if (infoHandler.getPlayer().id == players[i].id) { infoHandler.setReady(manager.isReady()); infoHandler.setPlayer(players[i]); infoHandler.setTurn(manager.getTurnIndex()); } } }
void populatePlayers() { foreach (var player in manager.getPlayers()) { var playerObject = Instantiate(playerPrefab, new Vector2(), Quaternion.identity); playerObject.transform.SetParent(playerGrid.transform, false); playerObject.transform.localScale = Vector3.one; InfoHandler infoHandler = playerObject.GetComponent <InfoHandler>(); infoHandler.setPlayer(player); infoHandler.setTurn(manager.getTurnIndex()); playerObjects.Add(playerObject); } }