internal static void DeserializeBeatmapData(IReadonlyBeatmapData beatmapData) { NoodleEventDatas = new Dictionary <CustomEventData, NoodleEventData>(); foreach (CustomEventData customEventData in ((CustomBeatmapData)beatmapData).customEventsData) { NoodleEventData noodleEventData; switch (customEventData.type) { case ANIMATETRACK: case ASSIGNPATHANIMATION: noodleEventData = ProcessCoroutineEvent(customEventData, beatmapData); break; case ASSIGNPLAYERTOTRACK: noodleEventData = new NoodlePlayerTrackEventData() { Track = GetTrackPreload(customEventData.data, beatmapData), }; break; case ASSIGNTRACKPARENT: noodleEventData = ProcessParentTrackEvent(customEventData.data, beatmapData); break; default: continue; } NoodleEventDatas.Add(customEventData, noodleEventData); } }
internal static void Callback(CustomEventData customEventData) { if (customEventData.type == ASSIGNPLAYERTOTRACK) { NoodlePlayerTrackEventData noodleData = (NoodlePlayerTrackEventData)NoodleEventDatas[customEventData]; Track track = noodleData.Track; if (track != null) { PlayerTrack.AssignTrack(track); } } }