Skip to content

Commit

Permalink
fix: fixing assert when loading scene using its name
Browse files Browse the repository at this point in the history
  • Loading branch information
James-Frowen committed Sep 22, 2021
1 parent 6a97ae9 commit 72ac3a6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Assets/Mirage/Runtime/NetworkSceneManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -672,13 +672,19 @@ private async UniTask LoadSceneNormalAsync(string scenePath)
}

await SceneLoadingAsyncOperationInfo;

logger.Assert(scenePath == ActiveScenePath, "[NetworkSceneManager] - Scene being loaded was not the active scene");
AssertSceneIsActive(scenePath);

CompleteLoadingScene(ActiveScenePath, SceneOperation.Normal);
}
}

[System.Diagnostics.Conditional("DEBUG")]
private void AssertSceneIsActive(string scenePath)
{
// equal to path or name of active scene
logger.Assert(scenePath == ActiveScenePath || scenePath == SceneManager.GetActiveScene().name, "[NetworkSceneManager] - Scene being loaded was not the active scene");
}

/// <summary>
/// Load our scene additively.
/// </summary>
Expand Down

0 comments on commit 72ac3a6

Please sign in to comment.