void ListPlayers() { if (PhotonNetwork.InRoom) { for (int i = 0; i < PhotonNetwork.PlayerList.Length; i++) { GameObject tempNickNameObject = Instantiate(playerListingPrefab, playersPanel); ScriptPlayerListing spl = tempNickNameObject.GetComponent <ScriptPlayerListing>(); string nickname = RemoveIdFromNickname(PhotonNetwork.PlayerList[i].NickName); spl.text_Nickname.text = nickname; } } }
void ListPlayers() { if (PhotonNetwork.InRoom) { for (int i = 0; i < PhotonNetwork.PlayerList.Length; i++) { GameObject tempNickNameObject = Instantiate(playerListingPrefab, playersPanel); ScriptPlayerListing spl = tempNickNameObject.GetComponent <ScriptPlayerListing>(); string nickname = PhotonNetwork.PlayerList[i].NickName; string cleanedNickname = Tools.RemoveIdFromNickname(nickname); spl.text_Nickname.text = cleanedNickname; int index = TeamManager.single_TM.GetTeamIndex(nickname); if (index >= 0) { spl.img.color = TeamManager.single_TM.teams[index].teamColor; } } } }
private void Awake() { splSingle = this; }