private void ListViewBackPressed() { DismissViewController(_videoListViewController); SongPreviewPlayer preview = Resources.FindObjectsOfTypeAll <SongPreviewPlayer>().First(); preview.FadeOut(); }
IEnumerator IEInstantiateAudioSource() { yield return(new WaitUntil(() => Resources.FindObjectsOfTypeAll <MainSettingsModelSO>().Any())); MainSettingsModelSO mainSettings = Resources.FindObjectsOfTypeAll <MainSettingsModelSO>().FirstOrDefault(); _maxPreviewVolume = mainSettings.volume * 0.5f; yield return(new WaitUntil(() => Resources.FindObjectsOfTypeAll <SongPreviewPlayer>().Any())); _songPreviewPlayer = Resources.FindObjectsOfTypeAll <SongPreviewPlayer>().FirstOrDefault(); _songPreviewPlayer.FadeOut(1); yield return(new WaitUntil(() => Resources.FindObjectsOfTypeAll <BeatmapLevelsModel>().Any())); BeatmapLevelsModel levelsModel = Resources.FindObjectsOfTypeAll <BeatmapLevelsModel>().FirstOrDefault(); BeatmapLevelPackCollectionSO packCollectionSO = levelsModel.ostAndExtrasPackCollection; BeatmapLevelPackSO[] levelPack = packCollectionSO.GetField <BeatmapLevelPackSO[]>("_beatmapLevelPacks"); BeatmapLevelCollectionSO levelCollectionSO = levelPack[5].GetField <BeatmapLevelCollectionSO>("_beatmapLevelCollection"); BeatmapLevelSO[] levels = levelCollectionSO.GetField <BeatmapLevelSO[]>("_beatmapLevels"); AudioClip clip = levels[1].GetField <AudioClip>("_audioClip"); _audioSource = new GameObject("SSAudSource").AddComponent <AudioSource>(); _audioSource.clip = clip; _audioSource.spatialBlend = 0; _audioSource.loop = true; _audioSource.volume = 0; _audioSource.time = 20f; _audioSource.Play(); }
private void StopPreview() { previewPlaying = false; ScreenManager.Instance.PrepareVideo(selectedLevelVideo); ScreenManager.Instance.PauseVideo(); songPreviewPlayer.FadeOut(); _videoDetailViewController.SetPreviewState(previewPlaying); }