private void SceneManager_activeSceneChanged(UnityEngine.SceneManagement.Scene arg0, UnityEngine.SceneManagement.Scene arg1) { if (arg1.name == "Menu") { if (_characteristicViewController == null) { _characteristicViewController = Resources.FindObjectsOfTypeAll <BeatmapCharacteristicSelectionViewController>().FirstOrDefault(); if (_characteristicViewController == null) { return; } _characteristicViewController.didSelectBeatmapCharacteristicEvent += _characteristicViewController_didSelectBeatmapCharacteristicEvent; } if (_soloFlowCoordinator == null) { _soloFlowCoordinator = Resources.FindObjectsOfTypeAll <SoloFreePlayFlowCoordinator>().FirstOrDefault(); if (_soloFlowCoordinator == null) { return; } _soloDetailView = _soloFlowCoordinator.GetPrivateField <StandardLevelDetailViewController>("_levelDetailViewController"); _practiceViewController = _soloFlowCoordinator.GetPrivateField <PracticeViewController>("_practiceViewController"); if (_soloDetailView != null) { _soloDetailView.didPressPlayButtonEvent += _soloDetailView_didPressPlayButtonEvent; } else { Log("Detail View Null", Plugin.LogLevel.Info); } if (_practiceViewController != null) { _practiceViewController.didPressPlayButtonEvent += _practiceViewController_didPressPlayButtonEvent; } else { Log("Practice View Null", Plugin.LogLevel.Info); } } if (_partyFlowCoordinator == null) { _partyFlowCoordinator = Resources.FindObjectsOfTypeAll <PartyFreePlayFlowCoordinator>().FirstOrDefault(); } if (saveRequested) { Settings.Save(); saveRequested = false; } } }
public static void InitializeCoordinators() { if (_characteristicViewController == null) { _characteristicViewController = Resources.FindObjectsOfTypeAll <BeatmapCharacteristicSelectionViewController>().FirstOrDefault(); if (_characteristicViewController == null) { return; } _characteristicViewController.didSelectBeatmapCharacteristicEvent += _characteristicViewController_didSelectBeatmapCharacteristicEvent; } if (_soloFlowCoordinator == null) { _soloFlowCoordinator = Resources.FindObjectsOfTypeAll <SoloFreePlayFlowCoordinator>().FirstOrDefault(); if (_soloFlowCoordinator == null) { return; } _soloDetailView = _soloFlowCoordinator.GetField <StandardLevelDetailViewController>("_levelDetailViewController"); _practiceViewController = _soloFlowCoordinator.GetField <PracticeViewController>("_practiceViewController"); if (_soloDetailView != null) { _soloDetailView.didPressPlayButtonEvent += _soloDetailView_didPressPlayButtonEvent; } else { ChromaLogger.Log("Detail View Null", ChromaLogger.Level.WARNING); } if (_practiceViewController != null) { _practiceViewController.didPressPlayButtonEvent += _practiceViewController_didPressPlayButtonEvent; } else { ChromaLogger.Log("Practice View Null", ChromaLogger.Level.WARNING); } } if (_partyFlowCoordinator == null) { _partyFlowCoordinator = Resources.FindObjectsOfTypeAll <PartyFreePlayFlowCoordinator>().FirstOrDefault(); } }
public void OnActiveSceneChanged(Scene prevScene, Scene nextScene) { if (nextScene.name == "MenuCore") { if (_soloFlowCoordinator == null) { _soloFlowCoordinator = Resources.FindObjectsOfTypeAll <SoloFreePlayFlowCoordinator>().FirstOrDefault(); if (_soloFlowCoordinator == null) { return; } _soloDetailView = _soloFlowCoordinator.GetPrivateField <StandardLevelDetailViewController>("_levelDetailViewController"); _practiceViewController = _soloFlowCoordinator.GetPrivateField <PracticeViewController>("_practiceViewController"); if (_soloDetailView != null) { _soloDetailView.didPressPlayButtonEvent += _soloDetailView_didPressPlayButtonEvent; } else { Log("Detail View Null", Plugin.LogLevel.Info); } if (_practiceViewController != null) { _practiceViewController.didPressPlayButtonEvent += _practiceViewController_didPressPlayButtonEvent; } else { Log("Practice View Null", Plugin.LogLevel.Info); } } if (_partyFlowCoordinator == null) { _partyFlowCoordinator = Resources.FindObjectsOfTypeAll <PartyFreePlayFlowCoordinator>().FirstOrDefault(); } if (saveRequested) { Settings.Save(); saveRequested = false; } } }
public void SceneManagerOnActiveSceneChanged(Scene arg0, Scene scene) { if (isMenuScene(scene)) { try { flowCoordinator = Resources.FindObjectsOfTypeAll <MainFlowCoordinator>().FirstOrDefault(); mainMenuViewController = flowCoordinator.GetPrivateField <MainMenuViewController>("_mainMenuViewController"); //soloModeSelectionViewController = flowCoordinator.GetPrivateField<SoloModeSelectionViewController>("_soloFreePlayFlowCoordinator"); soloFreePlayFlowCoordinator = flowCoordinator.GetPrivateField <SoloFreePlayFlowCoordinator>("_soloFreePlayFlowCoordinator"); detailViewController = soloFreePlayFlowCoordinator.GetPrivateField <StandardLevelDetailViewController>("_levelDetailViewController"); gameplaySetupViewController = soloFreePlayFlowCoordinator.GetPrivateField <GameplaySetupViewController>("_gameplaySetupViewController"); practiceController = soloFreePlayFlowCoordinator.GetPrivateField <PracticeViewController>("_practiceViewController"); beatmapDifficultyViewController = soloFreePlayFlowCoordinator.GetPrivateField <BeatmapDifficultyViewController>("_beatmapDifficultyViewControllerViewController"); listViewController = soloFreePlayFlowCoordinator.GetPrivateField <LevelListViewController>("_levelListViewController"); levelListView = listViewController.GetPrivateField <LevelListTableView>("_levelListTableView"); tableView = levelListView.GetPrivateField <TableView>("_tableView"); gameScenesManager = Resources.FindObjectsOfTypeAll <GameScenesManager>().FirstOrDefault(); standardLevelReturnToMenu = Resources.FindObjectsOfTypeAll <StandardLevelReturnToMenuController>().FirstOrDefault(); } catch (Exception e) { Console.WriteLine(e); } } if (isGameScene(scene)) { if (autoPlay) { } } Console.WriteLine(scene.name); }