Example #1
0
    public void OnMatchList(bool success, string extendedInfo, List <MatchInfoSnapshot> matchList)
    {
        listStatus.text = "";

        if (!success || matchList == null || matchList.Count == 0)
        {
            listStatus.text = "No servers";
            return;
        }

        foreach (MatchInfoSnapshot item in matchList)
        {
            GameObject serverListItemIns = Instantiate(serverListItemPrefab);
            serverListItemIns.transform.SetParent(serverListContanier);

            RoomListItem serverListItem = serverListItemIns.GetComponent <RoomListItem>();
            if (serverListItem != null)
            {
                serverListItem.SetMatch(item, OnJoinRoom);
            }

            serverList.Add(serverListItemIns);
        }
    }