Skip to content

Commit

Permalink
fix: console errors on first time launch
Browse files Browse the repository at this point in the history
  • Loading branch information
labbbirder committed Aug 8, 2024
1 parent 630b1db commit 48ba7f7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
11 changes: 6 additions & 5 deletions Editor/EditorInitializer.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEditor;
using UnityEngine;

Expand All @@ -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]
Expand Down
12 changes: 7 additions & 5 deletions Editor/Implements/EditorWeaveImplement.Incremental.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>",
"dependencies": {
Expand Down

0 comments on commit 48ba7f7

Please sign in to comment.