update extension sample

This commit is contained in:
何冠峰
2024-12-25 17:24:48 +08:00
parent 16117b67f1
commit 8d1f0d2010
7 changed files with 157 additions and 33 deletions
@@ -1,6 +1,7 @@
#if UNITY_WEBGL && BYTEMINIGAME
using UnityEngine;
using UnityEngine.Networking;
using WeChatWASM;
using YooAsset;
internal class BGFSLoadBundleOperation : FSLoadBundleOperation
@@ -48,9 +49,19 @@ internal class BGFSLoadBundleOperation : FSLoadBundleOperation
if (CheckRequestResult())
{
_steps = ESteps.Done;
Result = (_webRequest.downloadHandler as DownloadHandlerAssetBundle).assetBundle;
Status = EOperationStatus.Succeed;
var assetBundle = (_webRequest.downloadHandler as DownloadHandlerAssetBundle).assetBundle;
if (assetBundle == null)
{
_steps = ESteps.Done;
Error = $"{nameof(DownloadHandlerAssetBundle)} loaded asset bundle is null !";
Status = EOperationStatus.Failed;
}
else
{
_steps = ESteps.Done;
Result = new AssetBundleResult(_fileSystem, _bundle, assetBundle, null);
Status = EOperationStatus.Succeed;
}
}
else
{