diff --git a/UnityProject/Assets/HotUpdateResources/Dll/Hidden~/HotUpdateScripts.dll b/UnityProject/Assets/HotUpdateResources/Dll/Hidden~/HotUpdateScripts.dll index 385c7212..1a37375b 100644 Binary files a/UnityProject/Assets/HotUpdateResources/Dll/Hidden~/HotUpdateScripts.dll and b/UnityProject/Assets/HotUpdateResources/Dll/Hidden~/HotUpdateScripts.dll differ diff --git a/UnityProject/Assets/HotUpdateResources/Dll/Hidden~/HotUpdateScripts.pdb b/UnityProject/Assets/HotUpdateResources/Dll/Hidden~/HotUpdateScripts.pdb index a8a12e61..d6aad5c7 100644 Binary files a/UnityProject/Assets/HotUpdateResources/Dll/Hidden~/HotUpdateScripts.pdb and b/UnityProject/Assets/HotUpdateResources/Dll/Hidden~/HotUpdateScripts.pdb differ diff --git a/UnityProject/HotUpdateScripts/JEngine/Core/JPrefab.cs b/UnityProject/HotUpdateScripts/JEngine/Core/JPrefab.cs index 18aa1db4..b368b7fa 100644 --- a/UnityProject/HotUpdateScripts/JEngine/Core/JPrefab.cs +++ b/UnityProject/HotUpdateScripts/JEngine/Core/JPrefab.cs @@ -78,12 +78,12 @@ private JPrefab(string path, string package, bool async, Action c } if (async) { - _ = LoadPrefabAsync(path, complete); + LoadPrefabAsync(path, package, complete).Coroutine(); } else { - var obj = AssetMgr.Load(path); - Instance = obj != null ? obj as GameObject : null; + var obj = AssetMgr.Load(path, package); + Instance = obj; Loaded = true; } this.path = path; @@ -95,17 +95,18 @@ private JPrefab(string path, string package, bool async, Action c /// public async Task WaitForAsyncLoading() { - while(!Loaded) + await Task.Delay(1); + while (!Loaded && !Error) { await Task.Delay(1); } } - private async Task LoadPrefabAsync(string path, Action callback) + private async ET.ETTask LoadPrefabAsync(string path, string package, Action callback) { - var obj = await AssetMgr.LoadAsync(path); - Instance = obj != null ? obj as GameObject : null; + var obj = await AssetMgr.LoadAsync(path, package); + Instance = obj; Loaded = true; callback?.Invoke(!Error, this); }