private void LevelsFinishedHandler() { var result = new GameSystemResult() { GameSystemType = GameSystemType.Story, RoomName = _currentRoom.NextRoomName, ShowOverlay = true }; CurrentSubsystem.OnSubsystemChange?.Invoke(Subsystem.SubsystemType.NONE); if (!string.IsNullOrEmpty(_currentRoom.KeyToAddWhenFinished)) { Arguments.Services.DataService.AddKey(_currentRoom.KeyToAddWhenFinished); } this.StartGameCoroutine(finishSystemAsync()); IEnumerator finishSystemAsync() { if (!string.IsNullOrEmpty(_currentRoom.NodeToPlayOnFinish)) { RunDialogueNode(_currentRoom.NodeToPlayOnFinish); yield return(new WaitForSeconds(2)); } //TODO: refactor this to appropriate feature Arguments.Services.Sound.StopMusic(); Arguments.Services.Camera.CameraGlitchController.SetProperties(true, 3, 4); Arguments.Services.Camera.SetGlitchActive(true); Arguments.Services.Sound.PlayOneShot(_glitchAudioClip, 9f); yield return(new WaitForSeconds(1)); Finish(result); Arguments.Services.Camera.SetGlitchActive(false); Arguments.Services.Sound.StopSoundEffects(); } }
private void GameSystemFinishHandler(GameSystemResult result) { StartCoroutine(LoadGameSystemAsync(result.RoomName, result.GameSystemType, result.ShowOverlay, result.IsLongFadeDuration)); }
public virtual void Finish(GameSystemResult result) { // exit the gamesystem OnFinished?.Invoke(result); Terminate(); }