From b40a06358236f83edb2dcea00ba6597587d1550b Mon Sep 17 00:00:00 2001 From: walon Date: Wed, 8 Oct 2025 22:25:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DScriptObject=E4=B8=AD?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E5=87=BD=E6=95=B0=E5=90=8D=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E6=9C=AA=E8=A2=AB=E7=A6=81=E7=94=A8=E6=B7=B7=E6=B7=86=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ObfusPasses/SymbolObfus/Policies/UnityRenamePolicy.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Editor/ObfusPasses/SymbolObfus/Policies/UnityRenamePolicy.cs b/Editor/ObfusPasses/SymbolObfus/Policies/UnityRenamePolicy.cs index 594c5a1..cb13e22 100644 --- a/Editor/ObfusPasses/SymbolObfus/Policies/UnityRenamePolicy.cs +++ b/Editor/ObfusPasses/SymbolObfus/Policies/UnityRenamePolicy.cs @@ -124,14 +124,14 @@ namespace Obfuz.ObfusPasses.SymbolObfus.Policies private readonly CachedDictionary _computeDeclaringTypeDisableAllMemberRenamingCache; private readonly CachedDictionary _isSerializableCache; - private readonly CachedDictionary _isInheritFromMonoBehaviourCache; + private readonly CachedDictionary _isInheritFromMonoBehaviourOrScriptableObjectCache; private readonly CachedDictionary _isScriptOrSerializableTypeCache; public UnityRenamePolicy() { _computeDeclaringTypeDisableAllMemberRenamingCache = new CachedDictionary(ComputeDeclaringTypeDisableAllMemberRenaming); _isSerializableCache = new CachedDictionary(MetaUtil.IsSerializableType); - _isInheritFromMonoBehaviourCache = new CachedDictionary(MetaUtil.IsInheritFromMonoBehaviour); + _isInheritFromMonoBehaviourOrScriptableObjectCache = new CachedDictionary(MetaUtil.IsScriptType); _isScriptOrSerializableTypeCache = new CachedDictionary(MetaUtil.IsScriptOrSerializableType); } @@ -201,7 +201,7 @@ namespace Obfuz.ObfusPasses.SymbolObfus.Policies public override bool NeedRename(MethodDef methodDef) { TypeDef typeDef = methodDef.DeclaringType; - if (s_monoBehaviourEvents.Contains(methodDef.Name) && _isInheritFromMonoBehaviourCache.GetValue(typeDef)) + if (s_monoBehaviourEvents.Contains(methodDef.Name) && _isInheritFromMonoBehaviourOrScriptableObjectCache.GetValue(typeDef)) { return false; }