Ejemplo n.º 1
0
        private void SwitchToNextMap()
        {
            if (nextSong == null || nextBeatmap == null || nextMapDiffInfo == null)
            {
                return;
            }
            if (BS_Utils.Plugin.LevelData.GameplayCoreSceneSetupData.playerSpecificSettings.environmentEffectsFilterDefaultPreset == EnvironmentEffectsFilterPreset.NoEffects)
            {
                nextBeatmap.SetField <BeatmapData, List <BeatmapEventData> >("_beatmapEventsData", new BeatmapEventData[0].ToList());
            }

            AudioClip oldClip = GameObjects.songAudio.clip;

            TwitchPowers.ResetTimeSync(nextSong, 0f, nextSongInfo.songTimeOffset, 1f);
            TwitchPowers.ManuallySetNJSOffset(GameObjects.spawnController, nextMapDiffInfo.noteJumpMovementSpeed,
                                              nextMapDiffInfo.noteJumpStartBeatOffset, nextSongInfo.beatsPerMinute);



            //    TwitchPowers.ClearCallbackItemDataList(callBackDataList);
            // DestroyNotes();
            TwitchPowers.DestroyObjectsRaw();
            TwitchPowers.ResetNoteCutSoundEffects(seManager);
            callbackController.SetField("_spawningStartTime", 0f);
            callbackController.SetNewBeatmapData(nextBeatmap);
            UpdatePauseMenu();
            ClearSoundEffects();
            //Destroying audio clip is actually bad idea
            //   IPA.Utilities.Async.UnityMainThreadTaskScheduler.Factory.StartNew(() => { oldClip.UnloadAudioData(); AudioClip.Destroy(oldClip); });
            Task.Run(PrepareNextSong);
            CheckIntroSkip();
            ResetProgressUI();
        }