示例#1
0
    public void Init()
    {
        GameObject prefab = Resources.Load("Lobby/PlayButton") as GameObject;

        m_startBtn = ((GameObject)Instantiate(prefab)).GetComponent <LobbyButton>();
        m_startBtn.Init();
    }
示例#2
0
    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);
        }
    }