diff --git a/Editor/EditorInitializer.cs b/Editor/EditorInitializer.cs index 36e8123..2e04e5b 100644 --- a/Editor/EditorInitializer.cs +++ b/Editor/EditorInitializer.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Linq; using UnityEditor; using UnityEngine; @@ -13,11 +14,11 @@ static void EditorModeSetup() Logger.loggerLevel = UnityInjectionSettings.instance.loggerLevel; SetupImplements(); InjectionDriver.Instance.OnDomainReload(); - try - { - InjectionDriver.Instance.AutoInstallOnInitialize(); - } - catch { } + // try + // { + // InjectionDriver.Instance.AutoInstallOnInitialize(); + // } + // catch { } } [RuntimeInitializeOnLoadMethod] diff --git a/Editor/Implements/EditorWeaveImplement.Incremental.cs b/Editor/Implements/EditorWeaveImplement.Incremental.cs index 8222570..7b20fe2 100644 --- a/Editor/Implements/EditorWeaveImplement.Incremental.cs +++ b/Editor/Implements/EditorWeaveImplement.Incremental.cs @@ -47,16 +47,18 @@ public void OnDomainReload_Incremental() if (missingInjectionInfos.Length > 0) { SafelyWeaveInjectionInfos(missingInjectionInfos); - EditorApplication.delayCall += () => - { + EditorApplication.delayCall += #if UNITY_2019_3_OR_NEWER - EditorUtility.RequestScriptReload(); + EditorUtility.RequestScriptReload; #else - UnityEditorInternal.InternalEditorUtility.RequestScriptReload(); + UnityEditorInternal.InternalEditorUtility.RequestScriptReload; #endif - }; EditorApplication.QueuePlayerLoopUpdate(); } + else + { + InjectionDriver.Instance.AutoInstallOnInitialize(); + } // EphemeronSettings.instance.weavingRecords = allInjectionInfos // .Select(WeavingRecord.FromInjectionInfo) diff --git a/package.json b/package.json index aade27b..d88b859 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "com.bbbirder.unity-injection", "displayName": "Unity Injection V2", "description": "Unity注入模块,可以运行时改变被注入函数实现。", - "version": "2.0.16", + "version": "2.0.17", "hideInEditor": false, "author": "bbbirder <502100554@qq.com>", "dependencies": {