File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -108,8 +108,15 @@ public static void Build()
108
108
using WeChatWasm ;
109
109
UnityWebRequest bundleReq = WXAssetBundle .GetAssetBundle (url ); // UnityWebRequestAssetBundle => WXAssetBundle
110
110
yield return bundleReq .SendWebRequest ();
111
- AssetBundle bundle = (bundleReq .downloadHandler as DownloadHandlerWXAssetBundle ).assetBundle ; // DownloadHandlerAssetBundle => DownloadHandlerWXAssetBundle
112
- bundle .WXUnload (); // bundle还是AssetBundle类型,但需要调用扩展方法WXUnload()才可真正卸载
111
+ if (bundleReq .isHttpError )
112
+ {
113
+ Debug .LogError (GetType () + " /ERROR/" + bundleReq .error );
114
+ }
115
+ else
116
+ {
117
+ AssetBundle bundle = (bundleReq .downloadHandler as DownloadHandlerWXAssetBundle ).assetBundle ; // DownloadHandlerAssetBundle => DownloadHandlerWXAssetBundle
118
+ bundle .WXUnload (false ); // bundle还是AssetBundle类型,但需要调用扩展方法WXUnload()才可真正卸载
119
+ }
113
120
```
114
121
115
122
- 注意事项
You can’t perform that action at this time.
0 commit comments