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

        if (matches == null)
        {
            statusText.text = "Ошибка поиска.";
            return;
        }

        ClearRoomList();
        foreach (MatchInfoSnapshot info in matches)
        {
            GameObject roomListItemObject = Instantiate(roomListItemPrefab);
            roomListItemObject.transform.SetParent(roomListParent);

            LobbyRoomListItem roomListItem = roomListItemObject.GetComponent <LobbyRoomListItem>();
            if (!success || roomListItem != null)
            {
                roomListItem.ShowMatchInfo(info, JoinRoom);
            }

            roomList.Add(roomListItemObject);
        }

        if (roomList.Count == 0)
        {
            statusText.text = "Свободных комнат не найдено.";
        }
    }
Ejemplo n.º 2
0
    private void OnMatchList(bool success, string extendedInfo, List <MatchInfoSnapshot> matches)
    {
        statusText.text = "";

        if (matches == null)
        {
            statusText.text = localizationManager.GetLocalizedValue("play_join_error");
            return;
        }

        ClearRoomList();
        foreach (MatchInfoSnapshot info in matches)
        {
            GameObject roomListItemObject = Instantiate(roomListItemPrefab) as GameObject;
            roomListItemObject.transform.SetParent(roomListParent, false);

            LobbyRoomListItem roomListItem = roomListItemObject.GetComponent <LobbyRoomListItem>();
            if (!success || roomListItem != null)
            {
                roomListItem.ShowMatchInfo(info, JoinRoom);
            }

            roomList.Add(roomListItemObject);
        }

        if (roomList.Count == 0)
        {
            statusText.text = localizationManager.GetLocalizedValue("play_join_norooms");
        }
    }