Rooms not showing
Hi!
I followed the tutorial from FirstGearGames (video :https://www.youtube.com/watch?v=AbGwORylKqo&list=PLkx8oFug638oMagBH2qj1fXOkvBr6nhzt&index=8&ab_channel=FirstGearGames) on the Listing Rooms tutorial, I described the code, but in that when he went to test it, he couldn't, but I couldn't, it showed up and I was already on the verge of collapse because I asked and asked if anyone knows why it doesn't work, here's the code for RoomListing:
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using Photon; using Photon.Pun; using Photon.Realtime; public class RoomListing : MonoBehaviour { [SerializeField] private Text _text; public RoomInfo RoomInfo { get; private set; } public void SetRoomInfo(RoomInfo roomInfo) { RoomInfo = roomInfo; _text.text = roomInfo.MaxPlayers + ", " + roomInfo.Name; } }
RoomListingMenu code:
using System.Collections; using System.Collections.Generic; using UnityEngine; using Photon; using Photon.Pun; using Photon.Realtime; public class RoomListingsMenu : MonoBehaviourPunCallbacks { [SerializeField] private Transform _content; [SerializeField] private RoomListing _roomListing; private List<RoomListing> _listings = new List<RoomListing>(); public override void OnRoomListUpdate(List<RoomInfo> roomList) { foreach (RoomInfo info in roomList) { if (info.RemovedFromList) { int index = _listings.FindIndex(x => x.RoomInfo.Name == info.Name); if (index != -1) { Destroy(_listings[index].gameObject); _listings.RemoveAt(index); } } else { RoomListing listing = Instantiate(_roomListing, _content); if (listing != null) listing.SetRoomInfo(info); _listings.Add(listing); } } } }
Please Help
Regards,
IndicateStudios! =)
Comments
-
-
Thanks!
0 -
But it´s deleted from Asset Store =(
0 -
It's part of the PUN 2 package. Ours is not deleted.
0 -
I mean the asset store for Asteroids Demo is deleted.
0 -
Download PUN 2 from the Asset Store. Read the readme and check out this folder:
Assets\Photon\PhotonUnityNetworking\Demos\DemoAsteroids
0