private async Task SetupSongSaber() { try { if (_beatmapData == null) { return; } if (!_beatmapData.GetField("_customSaber", out var songSaber)) { return; } var metaData = _mainAssetStore.GetAllMetaData(AssetTypeDefinition.CustomSaber); var saber = metaData.FirstOrDefault(x => x.ListName == songSaber.ToString()); if (saber == null) { return; } _saberSet.LeftSaber = new SaberModel(ESaberSlot.Left); _saberSet.RightSaber = new SaberModel(ESaberSlot.Right); await _saberSet.SetSaber(saber); } catch (Exception e) { Debug.LogError(e.ToString()); } }
public void UpdateBeatmap(List <BeatmapObjectData> newObjects, bool addLists = false) { BeatmapData newBeatmapData = (callbackController.GetField <IReadonlyBeatmapData, BeatmapCallbacksController>("_beatmapData") as BeatmapData); var beatmapDataItemsPerType = newBeatmapData.GetField <BeatmapDataSortedListForTypes <BeatmapDataItem>, BeatmapData>("_beatmapDataItemsPerType"); if (addLists) { beatmapDataItemsPerType.AddList <GameNote>(new SortedList <GameNote, BeatmapDataItem>(null)); beatmapDataItemsPerType.AddList <GameObstacle>(new SortedList <GameObstacle, BeatmapDataItem>(null)); } foreach (var newObject in newObjects) { newBeatmapData.AddBeatmapObjectData(newObject); } }