From 6021aa664cf1956146af89af16a4876ef3c1a647 Mon Sep 17 00:00:00 2001 From: kmyuhkyuk <2451614940@qq.com> Date: Sat, 29 Oct 2022 13:08:40 +0800 Subject: [PATCH] Update --- SkinHide/Utils/RefHelp.cs | 42 ++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/SkinHide/Utils/RefHelp.cs b/SkinHide/Utils/RefHelp.cs index 0644250..1b5a9f4 100644 --- a/SkinHide/Utils/RefHelp.cs +++ b/SkinHide/Utils/RefHelp.cs @@ -133,9 +133,21 @@ namespace SkinHide.Utils private T Instance; - public Type InType; + public Type InType + { + get + { + return TType; + } + } - public Type PropertyType; + public Type PropertyType + { + get + { + return PropertyInfo.PropertyType; + } + } public PropertyRef(PropertyInfo propertyinfo, object instance = null) { @@ -177,10 +189,6 @@ namespace SkinHide.Utils TType = PropertyInfo.DeclaringType; - InType = TType; - - PropertyType = PropertyInfo.PropertyType; - Instance = (T)instance; if (PropertyInfo.CanRead) @@ -272,9 +280,21 @@ namespace SkinHide.Utils private T Instance; - public Type InType; + public Type InType + { + get + { + return TType; + } + } - public Type FieldType; + public Type FieldType + { + get + { + return FieldInfo.FieldType; + } + } public FieldRef(FieldInfo fieldinfo, object instance = null) { @@ -341,10 +361,6 @@ namespace SkinHide.Utils TType = FieldInfo.DeclaringType; - InType = TType; - - FieldType = FieldInfo.FieldType; - Instance = (T)instance; HarmonyFieldRef = AccessTools.FieldRefAccess(FieldInfo); @@ -404,6 +420,4 @@ namespace SkinHide.Utils return GetEftMethod(GetEftType(func), flags, func2); } } - - }