12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- using HarmonyLib;
- using System.Linq;
- using UnityEngine;
- namespace SongCore.HarmonyPatches
- {
- [HarmonyPatch(typeof(BeatmapCharacteristicCollectionSO))]
- [HarmonyPatch("GetBeatmapCharacteristicBySerializedName", MethodType.Normal)]
- class CustomCharacteristicsPatch
- {
-
- static void Postfix(string serializedName, ref BeatmapCharacteristicSO __result)
- {
- if (__result == null)
- {
- if (Collections.customCharacteristics.Any(x => x.serializedName == serializedName))
- __result = Collections.customCharacteristics.FirstOrDefault(x => x.serializedName == serializedName);
- else
- __result = Collections.customCharacteristics.FirstOrDefault(x => x.serializedName == "MissingCharacteristic");
-
- }
- }
- }
-
- }
|