public void RebuildPlayerListName() { foreach (KeyValuePair <Guid, GameObject> item in listItems1) { LobbyPlayerListItem i = item.Value.GetComponent <LobbyPlayerListItem>(); i.SetName(roomPlayers1[item.Key].GetName()); } }
public void RebuildPlayerListReady() { foreach (KeyValuePair <Guid, GameObject> item in listItems1) { LobbyPlayerListItem i = item.Value.GetComponent <LobbyPlayerListItem>(); Debug.Log(i.Name.text + " : " + i.ReadyState.text); i.SetReadyState(roomPlayers1[item.Key].IsReady); } }
/// <summary> /// Used to update a list item tied to a particular player. /// allows ready state display to be changed /// </summary> /// <param name="player"></param> public void UpdateListItem(NetworkRoomPlayerExt player) { foreach (KeyValuePair <Guid, NetworkRoomPlayerExt> pair in roomPlayers1) { Debug.Log(pair.Key + " : " + pair.Value.GetName()); } try { LobbyPlayerListItem toUpdate = listItems1[player.id].GetComponent <LobbyPlayerListItem>(); //Update ListItem Name toUpdate.SetName(player.GetName()); //Update ListItem readystate toUpdate.SetReadyState(player.IsReady); } catch (KeyNotFoundException e) { Debug.Log("!!!!!!!!!!!!!!CANT FIND KEY!!!!!!!!!!!!"); } //RebuildPlayerList(); }