Hello everyone, stopped working method PhotonNetwork.GetRoomList (), but PhotonNetwork.countOfRooms shows that there is room. Please tell me what could be the reason, here's the code:
public class SearchRoom : MonoBehaviour
{
public UMP_Manager um;
public Text RoomListText = null;
public Transform RoomPanel = null;
public GameObject RoomInfoPrefab;
private List<GameObject> CacheRoomList = new List<GameObject>();
private float refresh = 1;
public void UpdateRoomList()
{
if (!PhotonNetwork.connected)return;
if (CacheRoomList.Count > 0)
{
foreach (GameObject g in CacheRoomList)
{
Destroy(g);
}
CacheRoomList.Clear();
}
RoomInfo[] rl = PhotonNetwork.GetRoomList();
if(rl.Length > 0)
{
RoomListText.text = string.Empty;
for (int i = 0; i < rl.Length; i++)
{
GameObject r = Instantiate(RoomInfoPrefab) as GameObject;
CacheRoomList.Add(r);
r.GetComponent<bl_RoomInfo>().GetInfo(rl[i], um);
r.transform.SetParent(RoomPanel, false);
}
}
else
{
RoomListText.text = "There is no room created yet, create your one.";
}
}
void Update()
{
if(refresh > 0) refresh -= Time.deltaTime;
else
{
UpdateRoomList();
refresh = 1;
}
}
}