Пример #1
0
    public void OnMatchList(bool success, string extentedInfo, List <MatchInfoSnapshot> matchList)
    {
        statut.text = "";
        if (matchList == null)
        {
            statut.text = "Problème de lors de la récupérationde la liste des serveurs ";
            return;
        }

        foreach (MatchInfoSnapshot match in matchList)
        {
            GameObject _roomListItemGo = Instantiate(roomListItemPrefab);
            _roomListItemGo.transform.SetParent(roomListParent);

            RoomListItems _roomListItems = _roomListItemGo.GetComponent <RoomListItems>();
            if (_roomListItems != null)
            {
                _roomListItems.Setup(match, JoinRoom);
            }

            roomList.Add(_roomListItemGo);
        }

        if (roomList.Count == 0)
        {
            statut.text = "Aucun serveur en ligne actuellement";
        }
    }
Пример #2
0
    public void OnMatchList(bool success, string extendedInfo, List <MatchInfoSnapshot> matchList)
    {
        status.text = "";

        if (!success || matchList == null)
        {
            status.text = "Couldn't get room list.";
            return;
        }

        foreach (MatchInfoSnapshot match in matchList)
        {
            GameObject _roomListItemGO = Instantiate(roomListItemPrefab);
            _roomListItemGO.transform.SetParent(roomListParent);

            RoomListItems _roomListItem = _roomListItemGO.GetComponent <RoomListItems>();
            if (_roomListItem != null)
            {
                _roomListItem.Setup(match, JoinRoom);
            }


            // as well as setting up a callback function that will join the game.

            roomList.Add(_roomListItemGO);
        }

        if (roomList.Count == 0)
        {
            status.text = "No rooms at the moment.";
        }
    }