Exemplo n.º 1
0
    private void OnMatchList(bool success, string extendedInfo, List <MatchInfoSnapshot> responseData)
    {
        status.text = "";

        if (responseData == null)
        {
            status.text = "Could'nt get server list.";
            return;
        }

        foreach (var server in responseData)
        {
            GameObject _serverListItemGO = Instantiate(serverListItemPrefab);
            _serverListItemGO.transform.SetParent(serverListParent);

            ServerListItem _serverListItem = _serverListItemGO.GetComponent <ServerListItem>();
            if (_serverListItem != null)
            {
                _serverListItem.Setup(server, JoinServer);
            }

            serverList.Add(_serverListItemGO);
        }
        if (serverList.Count == 0)
        {
            status.text = "No server found";
        }
    }
Exemplo n.º 2
0
    public void OnMatchList(bool success, string extendedinfo, List <MatchInfoSnapshot> responsedata)
    {
        _status.text = "";

        if (responsedata == null)
        {
            _status.text = "Couldn't get room list.";
            return;
        }

        foreach (MatchInfoSnapshot response in responsedata)
        {
            GameObject roomListItemGO = Instantiate(_roomListInst);
            roomListItemGO.transform.SetParent(_roomListParent);

            ServerListItem item = roomListItemGO.GetComponent <ServerListItem>();
            if (item != null)
            {
                item.Setup(response, JoinRoom);
            }


            _roomList.Add(roomListItemGO);
        }

        if (_roomList.Count == 0)
        {
            _status.text = "No servers found.";
        }
    }