void CreateGamesButton(GameToJoin game) { Transform PanelButton = transform.FindChild("Pnl_NetworkGames/Pnl_ListGames"); GameObject btn = Instantiate(Resources.Load("PlayTablePrefabs/UI/RoomButton/Btn_Room")) as GameObject; btn.transform.SetParent(PanelButton); btn.transform.FindChild("Text").GetComponent <Text> ().text = game.roomName + "\n" + game.LocalIp; // btn.GetComponent<Button> ().onClick.AddListener (() => WebsocketClient.instance.BeginConnection (game.LocalIp, game.roomName)); btn.GetComponent <Button>().onClick.AddListener(() => ShowRoomInfo()); }
public void AddGame(GameToJoin game) { AvailableGames.Add(game.LocalIp, game); DisplayGames(); }