using System.Collections; using System.Collections.Generic; using UnityEngine; using YooAsset; public static class AssetOperationHandleExtension { /* /// /// 获取资源对象 /// /// /// public static AssetOperationHandle GetAssetObject(this AssetOperationHandle thisHandle, out TAsset asset) where TAsset : UnityEngine.Object { if (thisHandle.Status != EOperationStatus.Succeed) { var assetInfo = thisHandle.GetAssetInfo(); Debug.LogWarning($"The {assetInfo.AssetPath}[{assetInfo.AssetType}] is not success. Error[{thisHandle.LastError}]"); } asset = thisHandle.AssetObject as TAsset; return thisHandle; } */ /// /// 等待异步执行完毕 /// public static AssetOperationHandle WaitForAsyncOperationComplete(this AssetOperationHandle thisHandle) { thisHandle.WaitForAsyncComplete(); return thisHandle; } }