Skip to content

Commit

Permalink
fix: Use path instead of name in Room Example
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Langsenkamp committed Apr 20, 2020
1 parent 2a2f76c commit 5d4bc47
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Assets/Mirror/Examples/Room/Scripts/NetworkRoomManagerExt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();
Expand Down

0 comments on commit 5d4bc47

Please sign in to comment.