private void HandleFindSystemScenes() { bool appFound = false; bool uiFound = false; for (int i = 0; i < SceneManager.sceneCount; i++) { Scene scene = SceneManager.GetSceneAt(i); if (PinouConstants.IS_APP_SCENE(scene.name)) { _appScene = scene; appFound = true; } else if (PinouConstants.IS_UI_SCENE(scene.name)) { _uiScene = scene; uiFound = true; } } if (appFound == false) { Debug.Log("No App Scene found."); } if (uiFound == false) { Debug.Log("No UI Scene found."); } }
private async void HandleFindAndLoadActiveGameScene() { if (_activeSceneLowLevelInfos.SceneIndex == -1) { Scene activeScene = SceneManager.GetActiveScene(); bool isGameSceneActive = PinouConstants.IS_GAME_SCENE(activeScene.name); if (isGameSceneActive == false) { for (int i = 0; i < SceneManager.sceneCount; i++) { Scene scene = SceneManager.GetSceneAt(i); if (PinouConstants.IS_GAME_SCENE(scene.name)) { SceneManager.SetActiveScene(scene); isGameSceneActive = true; } } } if (isGameSceneActive == true) { _activeSceneLowLevelInfos.SceneLoaded = true; _activeSceneLowLevelInfos.IsMenuScene = activeScene.name.ToLower().Contains("menu"); _activeSceneLowLevelInfos.SceneIndex = activeScene.buildIndex; _activeSceneLowLevelInfos.LoadProgress = 1f; _activeSceneLowLevelInfos.SceneName = activeScene.name; _activeSceneLowLevelInfos.Scene = activeScene; FindSceneInfos(ref activeScene); await Task.Delay(1); OnSceneLoadComplete.Invoke(_activeSceneLowLevelInfos.Scene); } else { Debug.Log("No Game Scene found."); } } }