mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
fix: Use path instead of name in Room Example
This commit is contained in:
parent
2a2f76c263
commit
5d4bc47d46
@ -25,7 +25,7 @@ public override void OnRoomStopClient()
|
||||
{
|
||||
// Demonstrates how to get the Network Manager out of DontDestroyOnLoad when
|
||||
// going to the offline scene to avoid collision with the one that lives there.
|
||||
if (gameObject.scene.name == "DontDestroyOnLoad" && !string.IsNullOrEmpty(offlineScene) && SceneManager.GetActiveScene().name != offlineScene)
|
||||
if (gameObject.scene.name == "DontDestroyOnLoad" && !string.IsNullOrEmpty(offlineScene) && SceneManager.GetActiveScene().path != offlineScene)
|
||||
SceneManager.MoveGameObjectToScene(gameObject, SceneManager.GetActiveScene());
|
||||
|
||||
base.OnRoomStopClient();
|
||||
@ -35,7 +35,7 @@ public override void OnRoomStopServer()
|
||||
{
|
||||
// Demonstrates how to get the Network Manager out of DontDestroyOnLoad when
|
||||
// going to the offline scene to avoid collision with the one that lives there.
|
||||
if (gameObject.scene.name == "DontDestroyOnLoad" && !string.IsNullOrEmpty(offlineScene) && SceneManager.GetActiveScene().name != offlineScene)
|
||||
if (gameObject.scene.name == "DontDestroyOnLoad" && !string.IsNullOrEmpty(offlineScene) && SceneManager.GetActiveScene().path != offlineScene)
|
||||
SceneManager.MoveGameObjectToScene(gameObject, SceneManager.GetActiveScene());
|
||||
|
||||
base.OnRoomStopServer();
|
||||
|
Loading…
Reference in New Issue
Block a user