Hello,
I want the room list to be shown when a player join a lobby, thus I use GetRoomList() in OnJoinedLobby(), like this:
However, if I call GetRoomList() in Awake(), the console will log the rooms existing in the lobby. And it also work when I make a button and make its Onclick to GetRoomList().
But I don't want GetRoomList() to be called in every frame, nor do I want to ask the player to press a button to show room list. Anybody know why it does not work in OnJoinedLobby()?
Sorry that I post this in the wrong place, but I can't delete this post. I have posted this question again in the right place:
forum.photonengine.com/discussion/9052/getroomlist-does-not-show-any-room-when-it-called-immediate-after-joining-a-lobby
I want the room list to be shown when a player join a lobby, thus I use GetRoomList() in OnJoinedLobby(), like this:
public override void OnJoinedLobby()
{
foreach (RoomInfo room in PhotonNetwork.GetRoomList())
{
Debug.Log("room name:" + room.Name + " " + room.PlayerCount);
}
}
It does not show anything.However, if I call GetRoomList() in Awake(), the console will log the rooms existing in the lobby. And it also work when I make a button and make its Onclick to GetRoomList().
But I don't want GetRoomList() to be called in every frame, nor do I want to ask the player to press a button to show room list. Anybody know why it does not work in OnJoinedLobby()?
Sorry that I post this in the wrong place, but I can't delete this post. I have posted this question again in the right place:
forum.photonengine.com/discussion/9052/getroomlist-does-not-show-any-room-when-it-called-immediate-after-joining-a-lobby