internal static IEnumerator DelayedStart(BeatmapObjectSpawnController beatmapObjectSpawnController) { yield return(new WaitForEndOfFrame()); BeatmapObjectSpawnController = beatmapObjectSpawnController; // prone to breaking if anything else implements these interfaces BeatmapObjectManager beatmapObjectManager = _beatmapObjectSpawnAccessor(ref beatmapObjectSpawnController) as BeatmapObjectManager; BeatmapObjectCallbackController coreSetup = _callbackControllerAccessor(ref beatmapObjectSpawnController) as BeatmapObjectCallbackController; IAudioTimeSource = _audioTimeSourceAccessor(ref coreSetup); IReadonlyBeatmapData beatmapData = _beatmapDataAccessor(ref coreSetup); beatmapObjectManager.noteWasCutEvent -= NoteColorizer.ColorizeSaber; beatmapObjectManager.noteWasCutEvent += NoteColorizer.ColorizeSaber; if (Harmony.HasAnyPatches(HARMONYID)) { if (beatmapData is CustomBeatmapData customBeatmap) { if (ChromaConfig.Instance.EnvironmentEnhancementsEnabled) { EnvironmentEnhancementManager.Init(customBeatmap, beatmapObjectSpawnController.noteLinesDistance); } } // please let me kill legacy LegacyLightHelper.Activate(beatmapData.beatmapEventsData); } }
internal static IEnumerator DelayedStart(BeatmapObjectSpawnController beatmapObjectSpawnController) { yield return(new WaitForEndOfFrame()); BeatmapObjectSpawnController = beatmapObjectSpawnController; // prone to breaking if anything else implements these interfaces BeatmapObjectManager beatmapObjectManager = (BeatmapObjectManager)_beatmapObjectSpawnAccessor(ref beatmapObjectSpawnController); BeatmapObjectCallbackController coreSetup = (BeatmapObjectCallbackController)_callbackControllerAccessor(ref beatmapObjectSpawnController); IAudioTimeSource = _audioTimeSourceAccessor(ref coreSetup); IReadonlyBeatmapData beatmapData = _beatmapDataAccessor(ref coreSetup); beatmapObjectManager.noteWasCutEvent -= NoteColorizer.ColorizeSaber; beatmapObjectManager.noteWasCutEvent += NoteColorizer.ColorizeSaber; if (ChromaIsActive) { if (beatmapData is CustomBeatmapData customBeatmap) { if (ChromaConfig.Instance !.EnvironmentEnhancementsEnabled) { EnvironmentEnhancementManager.Init(customBeatmap, beatmapObjectSpawnController.noteLinesDistance); } } try { // please let me kill legacy LegacyLightHelper.Activate(beatmapData.beatmapEventsData); } catch (System.Exception e) { Plugin.Logger.Log("Could not run Legacy Chroma Lights"); Plugin.Logger.Log(e); } } }