private void UpdateSongFinishedStats() { List <SongStatistic> songStatistics = PlayerControllers .Select(playerController => new SongStatistic(playerController.PlayerProfile.Name, playerController.PlayerProfile.Difficulty, playerController.PlayerScoreController.TotalScore)) .ToList(); statistics.RecordSongFinished(SongMeta, songStatistics); }
public void SkipToNextSentence() { double nextStartBeat = PlayerControllers.Select(it => it.GetNextStartBeat()).Min(); if (nextStartBeat < 0) { return; } double targetPositionInMillis = BpmUtils.BeatToMillisecondsInSong(SongMeta, nextStartBeat) - 500; if (targetPositionInMillis > 0 && targetPositionInMillis > PositionInSongInMillis) { songAudioPlayer.PositionInSongInMillis = targetPositionInMillis; } }
public void SkipToNextSentence() { double nextStartBeat = PlayerControllers.Select(it => it.GetNextStartBeat()).Min(); if (nextStartBeat < 0) { return; } // For debugging, go fast to next lyrics. In production, give the player some time to prepare. double offsetInMillis = Application.isEditor ? 500 : 1500; double targetPositionInMillis = BpmUtils.BeatToMillisecondsInSong(SongMeta, nextStartBeat) - offsetInMillis; if (targetPositionInMillis > 0 && targetPositionInMillis > PositionInSongInMillis) { songAudioPlayer.PositionInSongInMillis = targetPositionInMillis; } }
public void SkipToNextSingableNote() { IEnumerable <int> nextSingableNotes = PlayerControllers .Select(it => it.GetNextSingableNote(CurrentBeat)) .Where(nextSingableNote => nextSingableNote != null) .Select(nextSingableNote => nextSingableNote.StartBeat); if (nextSingableNotes.Count() <= 0) { return; } int nextStartBeat = nextSingableNotes.Min(); // For debugging, go fast to next lyrics. In production, give the player some time to prepare. double offsetInMillis = Application.isEditor ? 500 : 1500; double targetPositionInMillis = BpmUtils.BeatToMillisecondsInSong(SongMeta, nextStartBeat) - offsetInMillis; if (targetPositionInMillis > 0 && targetPositionInMillis > PositionInSongInMillis) { SkipToPositionInSong(targetPositionInMillis); } }
public void OpenSongInEditor() { int maxBeatToScore = PlayerControllers .Select(playerController => playerController.PlayerScoreController.NextBeatToScore) .Max(); SceneData.NextBeatToScore = Math.Max((int)CurrentBeat, maxBeatToScore); SceneData.PlayerProfileToScoreDataMap = new Dictionary <PlayerProfile, PlayerScoreControllerData>(); foreach (PlayerController playerController in PlayerControllers) { SceneData.PlayerProfileToScoreDataMap.Add(playerController.PlayerProfile, playerController.PlayerScoreController.ScoreData); } SongEditorSceneData songEditorSceneData = new SongEditorSceneData(); songEditorSceneData.PreviousSceneData = SceneData; songEditorSceneData.PreviousScene = EScene.SingScene; songEditorSceneData.PositionInSongInMillis = PositionInSongInMillis; songEditorSceneData.SelectedSongMeta = SongMeta; SceneNavigator.Instance.LoadScene(EScene.SongEditorScene, songEditorSceneData); }