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()); } }
private async Task SetupSongSaber() { try { GetTypes(); if (_cjdAtMethod == null || _cjdLevelCustomDataType == null) { return; } var songSaber = _cjdAtMethod?.Invoke(null, new[] { _cjdLevelCustomDataType?.GetValue(_beatmapData), "_customSaber" }); if (songSaber == null) { 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()); } }