AdditiveLevelsNetworkManager - comments

This commit is contained in:
MrGadget1024 2023-01-28 11:23:18 -05:00
parent 5bbad6fd2f
commit 7dd3ce0163

View File

@ -72,7 +72,7 @@ IEnumerator LoadAdditive(string sceneName)
isInTransition = true;
// This will return immediately if already faded in
// e.g. by UnloadAdditive above or by default startup state
// e.g. by UnloadAdditive or by default startup state
yield return fadeInOut.FadeIn();
// host client is on server...don't load the additive scene again
@ -91,6 +91,7 @@ IEnumerator LoadAdditive(string sceneName)
OnClientSceneChanged();
// Reveal the new scene content.
yield return fadeInOut.FadeOut();
}
@ -99,9 +100,10 @@ IEnumerator UnloadAdditive(string sceneName)
isInTransition = true;
// This will return immediately if already faded in
// e.g. by LoadAdditive above or by default startup state
// e.g. by LoadAdditive above or by default startup state.
yield return fadeInOut.FadeIn();
// host client is on server...don't unload the additive scene here.
if (mode == NetworkManagerMode.ClientOnly)
{
yield return SceneManager.UnloadSceneAsync(sceneName);
@ -115,8 +117,8 @@ IEnumerator UnloadAdditive(string sceneName)
OnClientSceneChanged();
// There is no call to FadeOut here on purpose.
// Expectation is that a LoadAdditive will follow
// that will call FadeOut after that scene loads.
// Expectation is that a LoadAdditive or full scene change
// will follow that will call FadeOut after that scene loads.
}
/// <summary>