mirror of
https://github.com/BepInEx/BepInEx.git
synced 2026-10-20 01:46:13 +00:00
Cache slider reflection methods
This commit is contained in:
1 parent
89c11bff4e
commit
d67e1e850b
1 file changed
+3
-2
@@ -16,6 +16,8 @@ namespace SliderUnlocker
|
||||
{
|
||||
public override string Name => "Slider Unlocker";
|
||||
|
||||
private static FieldInfo akf_dictInfo = (typeof(AnimationKeyInfo).GetField("dictInfo", BindingFlags.NonPublic | BindingFlags.Instance));
|
||||
|
||||
public SliderUnlocker()
|
||||
{
|
||||
var harmony = HarmonyInstance.Create("com.bepis.bepinex.sliderunlocker");
|
||||
@@ -118,8 +120,7 @@ namespace SliderUnlocker
|
||||
|
||||
if (rate < 0f || rate > 1f)
|
||||
{
|
||||
var dictInfo = (Dictionary<string, List<AnimationKeyInfo.AnmKeyInfo>>)
|
||||
(typeof(AnimationKeyInfo).GetField("dictInfo", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(__instance));
|
||||
var dictInfo = (Dictionary<string, List<AnimationKeyInfo.AnmKeyInfo>>)akf_dictInfo.GetValue(__instance);
|
||||
|
||||
List<AnimationKeyInfo.AnmKeyInfo> list = dictInfo[name];
|
||||
|
||||
|
||||
Reference in new issue
Block a user