From 874a7310957adc83373b183127452c089fb5fb21 Mon Sep 17 00:00:00 2001 From: johnche Date: Mon, 2 Dec 2024 11:30:57 +0800 Subject: [PATCH] [unity]add PUERTS_DISABLE_REFLECT_EXTENSION macro to disable extension methods in reflection mode, fix https://github.com/Tencent/puerts/issues/1847 --- .../core/upm/Runtime/Src/Default/TypeMapping/TypeRegister.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unity/Assets/core/upm/Runtime/Src/Default/TypeMapping/TypeRegister.cs b/unity/Assets/core/upm/Runtime/Src/Default/TypeMapping/TypeRegister.cs index abb5a83e67..a4bd58f835 100644 --- a/unity/Assets/core/upm/Runtime/Src/Default/TypeMapping/TypeRegister.cs +++ b/unity/Assets/core/upm/Runtime/Src/Default/TypeMapping/TypeRegister.cs @@ -547,7 +547,7 @@ internal int RegisterType( // extensionMethods // 因为内存问题与crash问题移入宏中 -#if PUERTS_REFLECT_ALL_EXTENSION || UNITY_EDITOR +#if (PUERTS_REFLECT_ALL_EXTENSION || UNITY_EDITOR) && !PUERTS_DISABLE_REFLECT_EXTENSION // #if UNITY_EDITOR && !PUERTS_REFLECT_ALL_EXTENSION && !PUERTS_IL2CPP_OPTIMIZATION // if (!UnityEditor.EditorApplication.isPlaying) // #endif