diff --git a/Assets/Scripts/Bridge/ResourcesManager.cs b/Assets/Scripts/Bridge/ResourcesManager.cs index 42023d3027..d81773cb3b 100644 --- a/Assets/Scripts/Bridge/ResourcesManager.cs +++ b/Assets/Scripts/Bridge/ResourcesManager.cs @@ -82,8 +82,12 @@ namespace GameLogic { { if (luaFunction != null) { + Debug.Log("ResourcesManager LoadAssetAsync luaFunc"); luaFunction.Call(name, obj); } + else { + Debug.Log("ResourcesManager LoadAssetAsync luaFunc ==null"); + } }); } diff --git a/Assets/Scripts/Core/ResMgr/ResourcesMgr/ResLoader/RuntimeResLoader.cs b/Assets/Scripts/Core/ResMgr/ResourcesMgr/ResLoader/RuntimeResLoader.cs index 006e8679b8..10e4d9a4ca 100644 --- a/Assets/Scripts/Core/ResMgr/ResourcesMgr/ResLoader/RuntimeResLoader.cs +++ b/Assets/Scripts/Core/ResMgr/ResourcesMgr/ResLoader/RuntimeResLoader.cs @@ -219,6 +219,7 @@ namespace ResMgr ResData resData = null; if (resFailedMap.TryGetValue(name, out resData)) { + Debug.LogError("RunttimeResLoader LoadAssetAsync ab name: " + name + " in resFailedMap!"); action(name, null); return; } @@ -227,13 +228,16 @@ namespace ResMgr if (resData.IsFinish) { resData.RefCount++; + Debug.LogError("RunttimeResLoader LoadAssetAsync ab name: " + name + " resData.IsFinish!"); action(name, resData.Asset as T); } else { + Debug.LogError("RunttimeResLoader LoadAssetAsync ab name: " + name + " resData not Finish!"); resData.RefCount++; resData.OnLoadFinish.AddListener(() => { + Debug.LogError("RunttimeResLoader LoadAssetAsync ab name: " + name + " resData.IsFinish 2!"); action(name, resData.Asset as T); }); } @@ -243,7 +247,7 @@ namespace ResMgr string path = ResPathConfig.GetABName(name); if (string.IsNullOrEmpty(path)) { - if (BaseLogger.isDebug) BaseLogger.LogErrorFormat("没有找到资源包{0}的AssetBundle!path:", name, path); + Debug.LogError("RunttimeResLoader LoadAssetAsync path err path: " + path); action(name, null); return; } @@ -252,25 +256,33 @@ namespace ResMgr resData.RefCount++; resData.OnLoadFinish.AddListener(() => { + Debug.LogError("RunttimeResLoader LoadAssetAsync ab name: " + name + " resData.IsFinish 3!"); action(name, resData.Asset as T); }); resMap.Add(name, resData); AssetBundleManager.Instance.LoadAssetBundleAsyn(path, (tmpLoader) => { + if (tmpLoader == null) + { + Debug.Log("RunttimeResLoader LoadAssetAsync tmpLoader == null abname: " + name); + } + if (tmpLoader.AbLoaderState == ABLoaderState.Failed) { - if (BaseLogger.isDebug) BaseLogger.LogErrorFormat("异步加载资源失败:{0}", name); + Debug.LogError("RunttimeResLoader LoadAssetAsync ABLoaderState.Failed ab name: " + name); OnLoadFailed(resData, tmpLoader); return; } tmpLoader.LoadAssetAsyn(name, (tmpAsset) => { if (tmpAsset != null) - resData.LoadSuccess(tmpLoader, tmpAsset); - else { + Debug.LogError("RunttimeResLoader LoadAssetAsync tmpAsset!=null ab name: " + name); + resData.LoadSuccess(tmpLoader, tmpAsset); + }else + { + Debug.LogError("RunttimeResLoader LoadAssetAsync tmpAsset==null ab name: " + name); OnLoadFailed(resData, tmpLoader); - if (BaseLogger.isDebug) BaseLogger.LogErrorFormat("异步加载资源失败:{0}", name); } }); }, ResPathConfig);