settings
This commit is contained in:
@@ -51,13 +51,36 @@ public class LevelLoadManager : MonoBehaviour
|
||||
StartCoroutine(CoroutineLoadLevel(levelName));
|
||||
}
|
||||
|
||||
/// <summary>When true, Main Menu bootstrap (matchmaker settings) owns the overlay; suppress duplicate work in <see cref="MainMenuManager"/>.</summary>
|
||||
public static bool BlocksMainMenuSettingsBootstrap { get; private set; }
|
||||
|
||||
IEnumerator CoroutineLoadLevel(string levelName){
|
||||
instance.Show();
|
||||
yield return new WaitForSeconds(transitionDuration);
|
||||
if(matchmadeUI.activeSelf){
|
||||
yield return new WaitForSeconds(3f);
|
||||
}
|
||||
yield return SceneManager.LoadSceneAsync(levelName);
|
||||
|
||||
bool mainMenuDestination = levelName == MainMenuManager.MainMenuSceneName;
|
||||
if (mainMenuDestination)
|
||||
BlocksMainMenuSettingsBootstrap = true;
|
||||
|
||||
AsyncOperation asyncLoad = SceneManager.LoadSceneAsync(levelName);
|
||||
yield return asyncLoad;
|
||||
|
||||
if (mainMenuDestination)
|
||||
{
|
||||
try
|
||||
{
|
||||
MainMenuManager menu = UnityEngine.Object.FindObjectOfType<MainMenuManager>();
|
||||
if (menu != null)
|
||||
yield return menu.FinishLoadingScreenAndApplySettings();
|
||||
}
|
||||
finally
|
||||
{
|
||||
BlocksMainMenuSettingsBootstrap = false;
|
||||
}
|
||||
}
|
||||
|
||||
instance.Hide();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user