protected override void DidActivate(bool firstActivation, ActivationType activationType) { _beatmapCharacteristics = Resources.FindObjectsOfTypeAll <BeatmapCharacteristicSO>(); _beatmapLevelsModel = Resources.FindObjectsOfTypeAll <BeatmapLevelsModelSO>().FirstOrDefault(); _contentModelSO = Resources.FindObjectsOfTypeAll <AdditionalContentModelSO>().FirstOrDefault(); if (firstActivation && activationType == ActivationType.AddedToHierarchy) { _playerManagementViewController = BeatSaberUI.CreateViewController <PlayerManagementViewController>(); _playerManagementViewController.gameplayModifiersChanged += UpdateLevelOptions; _playerManagementViewController.transferHostButtonPressed += TransferHostConfirmation; var dialogOrig = ReflectionUtil.GetPrivateField <SimpleDialogPromptViewController>(FindObjectOfType <MainFlowCoordinator>(), "_simpleDialogPromptViewController"); _passHostDialog = Instantiate(dialogOrig.gameObject).GetComponent <SimpleDialogPromptViewController>(); _hostLeaveDialog = Instantiate(dialogOrig.gameObject).GetComponent <SimpleDialogPromptViewController>(); _quickSettingsViewController = BeatSaberUI.CreateViewController <QuickSettingsViewController>(); _roomNavigationController = BeatSaberUI.CreateViewController <RoomNavigationController>(); _roomNavigationController.didFinishEvent += () => { LeaveRoom(); }; _searchKeyboard = BeatSaberUI.CreateViewController <CustomKeyboardViewController>(); _searchKeyboard.enterButtonPressed += SearchPressed; _searchKeyboard.backButtonPressed += () => { DismissViewController(_searchKeyboard); }; _searchKeyboard.allowEmptyInput = true; } ProvideInitialViewControllers(_roomNavigationController, _playerManagementViewController, _quickSettingsViewController); }
protected override void DidActivate(bool firstActivation, ActivationType activationType) { _beatmapCharacteristics = Resources.FindObjectsOfTypeAll <BeatmapCharacteristicSO>(); _standardCharacteristic = _beatmapCharacteristics.First(x => x.characteristicName == "Standard"); if (firstActivation && activationType == ActivationType.AddedToHierarchy) { _lastCharacteristic = _standardCharacteristic; _playerManagementViewController = BeatSaberUI.CreateViewController <PlayerManagementViewController>(); _playerManagementViewController.gameplayModifiersChanged += UpdateLevelOptions; _quickSettingsViewController = BeatSaberUI.CreateViewController <QuickSettingsViewController>(); _roomNavigationController = BeatSaberUI.CreateViewController <RoomNavigationController>(); _roomNavigationController.didFinishEvent += () => { LeaveRoom(); }; _searchKeyboard = BeatSaberUI.CreateViewController <CustomKeyboardViewController>(); _searchKeyboard.enterButtonPressed += SearchPressed; _searchKeyboard.backButtonPressed += () => { DismissViewController(_searchKeyboard); }; _searchKeyboard.allowEmptyInput = true; } ProvideInitialViewControllers(_roomNavigationController, _playerManagementViewController, _quickSettingsViewController); }