public void Init() { GameObject prefab = Resources.Load("Lobby/PlayButton") as GameObject; m_startBtn = ((GameObject)Instantiate(prefab)).GetComponent <LobbyButton>(); m_startBtn.Init(); }
public override void OnRoomListUpdate(List <RoomInfo> roomList) { foreach (LobbyButton button in _buttons) { Destroy(button.gameObject); } _buttons.Clear(); foreach (RoomInfo room in roomList) { LobbyButton button = Instantiate(buttonPrefab, scrollListContents); button.Init(room); _buttons.Add(button); } }