From c312080bf144780744f105fe44c068145e68b349 Mon Sep 17 00:00:00 2001 From: DarthCY <452710557@qq.com> Date: Wed, 27 Aug 2025 20:22:18 +0800 Subject: [PATCH] Make the DefineSymbola not auto update after reload scripts. This method consumed a lot of cpu times(more than 10000ms, 120Mb GC) after my scripts reloaded in a huge VR project based on Unity2019.4.40f1, windows10 with I7-8100 CPU and 16G RAM. It freezes my unity anytime when script reloaded, causing bad experience in developing. I think it's not necessary to do this after any scripts reload, just use it after switch platform, and manual reload by developers. --- .../HTC.UnityPlugin/VRModule/Editor/VRModuleManagerEditor.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Assets/HTC.UnityPlugin/VRModule/Editor/VRModuleManagerEditor.cs b/Assets/HTC.UnityPlugin/VRModule/Editor/VRModuleManagerEditor.cs index 1208684c..9aa1465e 100644 --- a/Assets/HTC.UnityPlugin/VRModule/Editor/VRModuleManagerEditor.cs +++ b/Assets/HTC.UnityPlugin/VRModule/Editor/VRModuleManagerEditor.cs @@ -362,7 +362,8 @@ public void OnActiveBuildTargetChanged(BuildTarget previousTarget, BuildTarget n } #endif - [DidReloadScripts] + //[DidReloadScripts] + [MenuItem("Tool/VIU/UpdateScriptingDefineSymbols")] public static void UpdateScriptingDefineSymbols() { if (!s_isUpdatingScriptingDefineSymbols)