PUN & SteamVR_LoadLevel

Options
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/

Comments

  • Spaggi
    Options
    Dude, thanks so much for sharing!

    It would be great if PUN incorporates a way to use SteamVR_LoadLevel without modification