Quantcast
Channel: Photon Unity Networking (PUN) — Photon Engine
Viewing all articles
Browse latest Browse all 8947

PUN & SteamVR_LoadLevel

$
0
0
Descriptions:
PhotonNetwork.LoadLevel(int levelNumber)/(string levelName):
 Called by user scripts to load/sync scene in Unity
Used to stop the messaging queue and sync scenes between players
NetworkingPeer.SetLevelInPropsIfSynced(int levelNumber)/(string levelName):
 Called by PhotonNetwork.LoadLevel(...)
Used to set/update the RoomCustomProperty NetworkingPeer.CurrentSceneProperty ("curScn")
"curScn": The string synced between players holding the current scene name
NetworkingPeer.LoadLevelIfSynced():
 Called by both OnJoinedRoom() & ReadoutProperties(...)
Used to sync the scene when joining the room or "curScn" changed (by MasterClient)
Also calls PhotonNetwork.LoadLevel(int levelNumber)/(string levelName) to load the new scene for the other clients

To use SteamVR_LoadLevel update PhotonNetwork.LoadLevel(int levelNumber)/(string levelName) to use the SteamVR_LoadLevel.Begin(int levelNumber)/(string levelName). (in my game I use the "Scripting Define Symbols" "VIVE" to denote this build is for use with the Vive.)
#if VIVE
SteamVR_LoadLevel.Begin(int levelNumber)/(string levelName);
#else
SceneManager.LoadScene(int levelNumber)/(string levelName);
#endif
NOTE SteamVR_LoadLevel.Begin(int levelNumber) does not exist yet, but you can follow these instructions on how to add it: https://steamcommunity.com/app/358720/discussions/0/333656722980764718/

Viewing all articles
Browse latest Browse all 8947

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>