void OnEnable() { if (done) { return; } // Get an array of players Player[] players = PlayerManager.GetAllPlayers(); foreach (Player player in players) { Debug.Log(player.playerNum + " | " + player.deaths); GameObject itemGO = Instantiate(scoreboardItem, scoreboardPlayerList); Debug.Log("otemGO: " + itemGO); PlayerScoreboardItem item = itemGO.GetComponent <PlayerScoreboardItem>(); Debug.Log(item); if (item != null) { item.Setup(player.playerNum, player.deaths); done = true; } } }
private void OnEnable() { Player[] players = GameManager.GetAllPlayers(); foreach (Player player in players) { GameObject itemGo = (GameObject)Instantiate(playerScoreboardItem, playerScoreboardList); PlayerScoreboardItem item = itemGo.GetComponent <PlayerScoreboardItem>(); if (item != null) { item.Setup(player.username, player.kills, player.deaths); } } }
void OnEnable() { Player[] players = GameManager.GetAllPlayers(); foreach (Player player in players) { GameObject ItemGO = Instantiate(playerScoreBoardItem, playerScoreBoardList); PlayerScoreboardItem item = ItemGO.GetComponent <PlayerScoreboardItem>(); if (item != null) { item.Setup(player.username, player.Kills, player.Deaths); } } }
void OnEnable() { Player[] players = GameManager.GetAllPlayers(); foreach (Player player in players) { GameObject itemGO = (GameObject)Instantiate(playerScoreboardItem, playerScoreboardList); PlayerScoreboardItem item = itemGO.GetComponent <PlayerScoreboardItem>(); if (item != null) { item.Setup(player); } } }
private void OnEnable() { TankManager[] tanks = GameManager.getAllPlayers(); foreach (var tank in tanks) { GameObject itemGO = Instantiate(playerScoreboardItemPrefab, playerScoreboardParent); PlayerScoreboardItem item = itemGO.GetComponent <PlayerScoreboardItem>(); if (item != null) { item.Setup(tank.username, tank.deaths); } } }
private void OnEnable() { Player[] players = GameManager.GetAllPlayers(); foreach (Player player in players) { GameObject itemGO = (GameObject)Instantiate(playerScoreboardItemPrefab, playerList); PlayerScoreboardItem item = itemGO.GetComponent <PlayerScoreboardItem>(); if (item != null) { item.Setup(player.name, player.kills.ToString(), player.deaths.ToString()); } } }
void OnEnable() { Player[] players = GameManager.GetAllPlayers(); foreach (Player player in players) { GameObject itemGO = (GameObject)Instantiate(playerScoreboardItem, playerScoreboardList); PlayerScoreboardItem item = itemGO.GetComponent <PlayerScoreboardItem>(); if (item != null) { Debug.Log(player._playerName + " k:" + player.kills.ToString() + "d:" + player.deaths.ToString()); item.Setup(player._playerName, player.kills, player.deaths); } } }
void OnEnable() { // Get an array of players Player[] players = GameManager.GetAllPlayers(); foreach (Player p in players) { GameObject itemGO = (GameObject)Instantiate(playerScoreboardItemPrefab, playerScoreboardList); PlayerScoreboardItem item = itemGO.GetComponent <PlayerScoreboardItem>(); if (item != null) { item.Setup(p.username, p.kills, p.death); } } }
private void OnEnable() { // TODO : Sort the list by score GameObject[] players = sgm.GetPlayers(); foreach (GameObject player in players) { GameObject itemGameObject = Instantiate(playerScoreboardItemPrefab, playerScoreboardList); PlayerScoreboardItem item = itemGameObject.GetComponent <PlayerScoreboardItem>(); if (item != null) { item.Setup(player.GetComponent <SnakeSetUpPlayer>().GetPlayerName(), player.GetComponent <SnakeTailController>().GetTail().Count); } } }
void OnEnable() { playersGO = GameObject.FindGameObjectsWithTag("Player"); foreach (GameObject player in playersGO) { GameObject itemGO = (GameObject)Instantiate(playerScoreboardItem); itemGO.transform.SetParent(playerScoreboardList); PlayerScoreboardItem item = itemGO.GetComponent <PlayerScoreboardItem>(); if (item != null) { item.Setup(player.GetComponent <Player>().username, player.GetComponent <Player>().GetKills(), player.GetComponent <Player>().GetDeaths(), player.GetComponent <Player>().GetBestCombo()); } } }
void OnEnable() { // Get an array of players Player[] players = GameManager.GetAllPlayers(); // Loop through and set up a list item for each one foreach (Player player in players) { //Debug.Log (player.username + " | " + player.kills + " | " + player.deaths); GameObject itemGO = (GameObject)Instantiate(playerScoreboardItem, playerScoreboardList); PlayerScoreboardItem item = itemGO.GetComponent <PlayerScoreboardItem> (); if (item != null) { item.Setup(player.username, player.kills, player.deaths); } } }
// Gets all player data on enabling void OnEnable() { // get and array of players List <Player> allPlayers = GameManager.GetAllPlayers(); GameManager.GetAllPlayers(); // loop through and set up a list item for each player foreach (Player player in allPlayers) { GameObject itemGo = Instantiate(playerScoreboardPrefab, playerScoreboardList); PlayerScoreboardItem item = itemGo.GetComponent <PlayerScoreboardItem>(); if (item) { item.Setup(player.name, player.kills); } } }
private void OnEnable() { Player[] players = GameManger.GetAllPlayers(); Array.Sort(players, ComparePlayers); foreach (Player player in players) { GameObject itemGO = Instantiate(playerScoreboardItem, playerScoreboardList) as GameObject; PlayerScoreboardItem item = itemGO.GetComponent <PlayerScoreboardItem>(); if (item != null) { item.Setup(player.playerName, player.score, player.kills, player.deaths); } if (player.isLocalPlayer) { item.GetComponent <Image>().color = Color.cyan; } } }
void OnEnable() { //Get anarray of players PlayerObject[] players = GameManagerCar.GetAllPlayers(); //Loop through andsetup listitem foreach one foreach (PlayerObject player in players) { Debug.Log(player.username + "|" + player.Kills + "|" + player.Deaths); GameObject itemGO = (GameObject)Instantiate(ScoreboardItem_Prefab, ScoreboardItem_Holder); PlayerScoreboardItem item = itemGO.GetComponent <PlayerScoreboardItem>(); if (item != null) { item.Setup(player.username, player.Kills, player.Deaths); } } }
//[Command] void GetAllPlayers() { SpellslingerScript[] spellSlingers = GameManager.GetAllPlayers(); foreach (SpellslingerScript spellSlinger in spellSlingers) { if (spellSlinger != null) { GameObject itemGO = (GameObject)Instantiate(playerScoreboardItemPrefab, playerScoreboardList); PlayerScoreboardItem item = itemGO.GetComponent <PlayerScoreboardItem>(); if (item != null) { Debug.Log("Spellslinger Name is: " + spellSlinger.name); item.Setup(spellSlinger.name, spellSlinger.GetComponent <Health>().GetPlayerDeaths(), spellSlinger.GetSpellslingerKills()); } } } }
void OnEnable() { Player[] players = GameManager.GetAllPlayers(); foreach (Player player in players) { GameObject itemGO = (GameObject)Instantiate(playerScoreboardItem, playerScoreboardList); PlayerScoreboardItem item = itemGO.GetComponent <PlayerScoreboardItem>(); if (item != null) { item.Setup(player.username, player.kills, player.deaths); } foreach (Renderer c in player.gameObject.GetComponentsInChildren <Renderer>()) { //Debug.Log(item.material.color+" "+ colorHolder.playerColor); c.material.color = player.playerColor; //Debug.Log(item.material.color + " " + colorHolder.playerColor); } } }