示例#1
0
        public void Update()
        {
            if (_hasFailed && (Configuration.Instance.autoSkip || _vrControllersInputManager.MenuButtonDown()) && !_skipped)
            {
                // Stop the base coroutine and call the necessary functions to fail the level as quickly as possible
                if (_standardLevel)
                {
                    _standardLevelFailedController.StopAllCoroutines();
                    LevelCompletionResults.LevelEndAction levelEndAction = _standardInitData.autoRestart ? LevelCompletionResults.LevelEndAction.Restart : LevelCompletionResults.LevelEndAction.None;
                    LevelCompletionResults levelCompletionResults        = _prepareLevelCompletionResults.FillLevelCompletionResults(LevelCompletionResults.LevelEndStateType.Failed, levelEndAction);
                    _standardLevelSceneSetupData.Finish(levelCompletionResults);
                }
                else
                {
                    _missionLevelFailedController.StopAllCoroutines();
                    LevelCompletionResults.LevelEndAction levelEndAction = _missionInitData.autoRestart ? LevelCompletionResults.LevelEndAction.Restart : LevelCompletionResults.LevelEndAction.None;
                    LevelCompletionResults levelCompletionResults        = _prepareLevelCompletionResults.FillLevelCompletionResults(LevelCompletionResults.LevelEndStateType.Failed, levelEndAction);

                    MissionObjectiveResult[] results = _missionObjectiveCheckersManager.GetResults();
                    MissionCompletionResults missionCompletionReuslts = new MissionCompletionResults(levelCompletionResults, results);

                    _missionLevelSceneSetupData.Finish(missionCompletionReuslts);
                }

                _skipped = true;
            }
        }
示例#2
0
        private void NoteWasCut(NoteController noteController, NoteCutInfo noteCutInfo)
        {
            if (noteController.noteData.colorType == ColorType.None || noteController.noteData.beatmapObjectType != BeatmapObjectType.Note)
            {
                return;
            }

            AllNotesCountDidChangeEvent(allNotesCount++, cuttableNotes);
            if (noteCutInfo.allIsOK)
            {
                NoteWasCutEvent((int)noteCutInfo.saberType);
                GoodCutCountDidChangeEvent(goodCutCount++);
            }
            else
            {
                BadCutCountDidChangeEvent(badCutCount++);
            }
            if (Mathf.Approximately(noteController.noteData.time, _lastNoteTime))
            {
                _lastNoteTime = 0f;
                LevelFinishedEvent();
                LevelCompletionResults results = _prepareLevelCompletionResults.FillLevelCompletionResults(LevelCompletionResults.LevelEndStateType.Cleared, LevelCompletionResults.LevelEndAction.None);
                if (results.modifiedScore > highScore)
                {
                    NewHighscore();
                }
            }
        }