public void SceneManagerOnActiveSceneChanged(Scene arg0, Scene scene) { if (isMenuScene(scene)) { flowController = Resources.FindObjectsOfTypeAll <StandardLevelSelectionFlowCoordinator>().FirstOrDefault(); navController = flowController.GetPrivateField <StandardLevelSelectionNavigationController>("_levelSelectionNavigationController"); listViewController = flowController.GetPrivateField <StandardLevelListViewController>("_levelListViewController"); difficultyViewController = flowController.GetPrivateField <StandardLevelDifficultyViewController>("_levelDifficultyViewController"); listTableView = listViewController.GetPrivateField <StandardLevelListTableView>("_levelListTableView"); tableView = listTableView.GetPrivateField <TableView>("_tableView"); detailViewController = flowController.GetPrivateField <StandardLevelDetailViewController>("_levelDetailViewController"); player = Resources.FindObjectsOfTypeAll <SongPreviewPlayer>().FirstOrDefault(); FixDiffOrder(); CreatUI(); CreateRandomButton(); } else { isShowing = false; } }
private void Awake() { try { _mainMenuViewController = Resources.FindObjectsOfTypeAll <MainMenuViewController>().First(); _soloModeSelectionViewController = Resources.FindObjectsOfTypeAll <SoloModeSelectionViewController>().First(); _levelSelectionFlowCoordinator = Resources.FindObjectsOfTypeAll <StandardLevelSelectionFlowCoordinator>().First(); _levelSelectionNavigationController = _levelSelectionFlowCoordinator.GetPrivateField <StandardLevelSelectionNavigationController>("_levelSelectionNavigationController"); _levelDetailViewController = _levelSelectionFlowCoordinator.GetPrivateField <StandardLevelDetailViewController>("_levelDetailViewController"); _levelDifficultyViewController = _levelSelectionFlowCoordinator.GetPrivateField <StandardLevelDifficultyViewController>("_levelDifficultyViewController"); _levelListViewController = _levelSelectionFlowCoordinator.GetPrivateField <StandardLevelListViewController>("_levelListViewController"); listTableView = _levelListViewController.GetPrivateField <StandardLevelListTableView>("_levelListTableView"); tableView = listTableView.GetPrivateField <TableView>("_tableView"); GetBeatSaberIcons(); AddModMenuButton(); leaderboardHooks = new LeaderboardsModelHooks(); leaderboardHooks.StartHooking(); } catch (Exception ex) { Console.WriteLine(ex.Message + "\n" + ex.StackTrace); } }