From 5d4bc47d46098f920f9e3468d0f276e336488e42 Mon Sep 17 00:00:00 2001 From: Chris Langsenkamp Date: Mon, 20 Apr 2020 11:04:18 -0400 Subject: [PATCH] fix: Use path instead of name in Room Example --- Assets/Mirror/Examples/Room/Scripts/NetworkRoomManagerExt.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/Mirror/Examples/Room/Scripts/NetworkRoomManagerExt.cs b/Assets/Mirror/Examples/Room/Scripts/NetworkRoomManagerExt.cs index d8a692dc8..bce48460f 100644 --- a/Assets/Mirror/Examples/Room/Scripts/NetworkRoomManagerExt.cs +++ b/Assets/Mirror/Examples/Room/Scripts/NetworkRoomManagerExt.cs @@ -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();