You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
wumiao1990
changed the title
unity使用 WXAssetBundle.GetAssetBundle(url)下载资源成功,但是assetbundle为空
unity使用 WXAssetBundle.GetAssetBundle(url)下载资源成功,但是assetbundle为空,用UnityWebRequestAssetBundle.GetAssetBundle又可以正常加载
Nov 22, 2024
描述Bug
UnityEngine.Networking.UnityWebRequest bundleReq = WeChatWASM.WXAssetBundle.GetAssetBundle(urlPath); // UnityWebRequestAssetBundle => WXAssetBundle
await bundleReq.SendWebRequest();
if (bundleReq.result == UnityEngine.Networking.UnityWebRequest.Result.Success)
{
UnityEngine.AssetBundle bundle = null;
try
{
var downloadHandler = bundleReq.downloadHandler;
bundle = (downloadHandler as DownloadHandlerWXAssetBundle)?.assetBundle; // DownloadHandlerAssetBundle => DownloadHandlerWXAssetBundle
Debug.LogError($"WXAssetBundle.GetAssetBundle Path:{urlPath} bundle:{bundle}");
}
catch (Exception e)
{
Logging.Error($"{GetType()} bundle is Null path:{urlPath} errorMsg:{e}");
}
if (bundle != null)
{
m_AssetBundle = bundle;
}
IsDone = true;
}
else
{
Logging.Error($"{GetType()} ERROR bundleReq.error path:{urlPath}");
}
bundleReq.Dispose();
运行环境
The text was updated successfully, but these errors were encountered: