This commit is contained in:
2026-05-06 01:32:09 +05:30
parent 184d4fbc04
commit c2144630fd
10 changed files with 1675 additions and 1605 deletions
@@ -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();
}