public void ShowResultsScreen() { if (!_radioNavController.viewControllers.Contains(_resultsScreenViewController)) { PushViewControllerToNavigationController(_radioNavController, _resultsScreenViewController, null, true); if (lastDifficulty == null || lastResults == null) { _resultsScreenViewController.SetSongInfo(channelInfo.currentSong, channelInfo.currentLevelOptions.difficulty); } else { _resultsScreenViewController.SetSongInfo(lastDifficulty, lastResults); } IPreviewBeatmapLevel level = SongCore.Loader.CustomBeatmapLevelPackCollectionSO.beatmapLevelPacks.SelectMany(x => x.beatmapLevelCollection.beatmapLevels).FirstOrDefault(x => x.levelID.StartsWith(channelInfo.currentSong.levelId)); if (level != null) { LoadBeatmapLevelAsync(level, (success, beatmapLevel) => { PreviewPlayer.CrossfadeTo(beatmapLevel.beatmapLevelData.audioClip, beatmapLevel.previewStartTime, Math.Max(totalTime - currentTime, beatmapLevel.previewDuration)); }); } } }
public void ShowResultsScreen() { if (!_radioNavController.viewControllers.Contains(_resultsScreenViewController)) { PushViewControllerToNavigationController(_radioNavController, _resultsScreenViewController, null, true); if (lastDifficulty == null || lastResults == null) { _resultsScreenViewController.SetSongInfo(channelInfo.currentSong, channelInfo.preferredDifficulty); } else { _resultsScreenViewController.SetSongInfo(lastDifficulty, lastResults); } LevelSO level = SongLoader.CustomLevelCollectionSO.levels.FirstOrDefault(x => x.levelID.StartsWith(channelInfo.currentSong.levelId)); if (level != null) { SongLoader.Instance.LoadAudioClipForLevel((CustomLevel)level, (levelLoaded) => { PreviewPlayer.CrossfadeTo(levelLoaded.audioClip, levelLoaded.previewStartTime, Math.Max(totalTime - currentTime, levelLoaded.previewDuration)); }); } } }