private IEnumerator _AddRowType2(DataLobby lobby) { yield return(new WaitForEndOfFrame()); types2.Add(LobbyRowType2.Create(lobby, tableType2)); tableType2.repositionNow = true; }
private void _UpdateLobbyType2(DataLobby lobby) { LobbyRowType2 lobbyRow = types2.Find(lb => lb.data.roomId == lobby.roomId); if (lobbyRow != null) { lobbyRow.setData(lobby); } }
IEnumerator initShowRowType2(List <DataLobby> lobbies) { ClearAllRow(); yield return(new WaitForEndOfFrame()); foreach (DataLobby item in lobbies) { types2.Add(LobbyRowType2.Create(item, tableType2)); } tableType2.repositionNow = true; }
public static LobbyRowType2 Create(DataLobby data, UITable parent) { GameObject go = GameObject.Instantiate(Resources.Load("Prefabs/Lobby/LobbyRowType2")) as GameObject; go.transform.parent = parent.transform; go.transform.localPosition = Vector3.zero; go.transform.localScale = Vector3.one; go.name = data.roomId + " - " + data.roomName; LobbyRowType2 item = go.GetComponent <LobbyRowType2>(); item.StartCoroutine(item.setData(data)); return(item); }
public void RemoveLobby(DataLobby lobby) { if (isShowType1) { LobbyRowType1 lobbyRow = types1.Find(lobbiesView => lobbiesView.data.roomId == lobby.roomId); if (lobbyRow != null && lobbyRow.gameObject != null) { GameObject.Destroy(lobbyRow.gameObject); types1.Remove(lobbyRow); } } else { LobbyRowType2 lobbyRow = types2.Find(lobbiesView => lobbiesView.data.roomId == lobby.roomId); GameObject.Destroy(lobbyRow.gameObject); types2.Remove(lobbyRow); } }