Quantcast
Channel: Recent Discussions — Photon Engine
Viewing all articles
Browse latest Browse all 15755

GetRoomList Problems

$
0
0

using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using System.Collections.Generic;
using System;

public class Connection : Photon.MonoBehaviour
{
// Dungeon Settings //
public string[] potprefabs;
public string[] chestprefabs;
public string dungeonPlayerPrefab;
// Hub Settings //
public string hubPlayerPrefab;
// Connection Settings //
public string Version = 1 + "." + SceneManagerHelper.ActiveSceneBuildIndex;

public string hubScene = "Hub";

void Start()
{
DontDestroyOnLoad(gameObject);
PhotonNetwork.autoJoinLobby = true;
}


void Update()
{
if (PhotonNetwork.connected == false)
{
PhotonNetwork.ConnectUsingSettings(Version);
}
}

void OnJoinedLobby()
{
Debug.Log("Joined Lobby, Attempting To Join Hub..");
}

void OnJoinedRoom()
{
Debug.Log("Joined Room " + PhotonNetwork.room.name);
}

void OnReceivedRoomListUpdate()
{
Debug.Log(PhotonNetwork.GetRoomList().Length);
}



}
This bit of code below is outputting 0 and i cant seem to find out why.. Is there a delay between the callabcks?


void OnReceivedRoomListUpdate()
{
Debug.Log(PhotonNetwork.GetRoomList().Length);
}

Viewing all articles
Browse latest Browse all 15755

Trending Articles