From 2bf29689392bc01222fce3dbd8c854c3717a590c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=B5=A9=E5=A4=A7=E4=BA=BA?= Date: Tue, 9 Jun 2026 17:56:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6=E8=87=B3?= =?UTF-8?q?=E3=80=8CYooAsset=5FAPI=E3=80=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- YooAsset_API/YooAsset_API_Reference_2.3.x.md | 7812 ++++++++++++++ YooAsset_API/YooAsset_API_Reference_3.0.md | 9654 ++++++++++++++++++ 2 files changed, 17466 insertions(+) create mode 100644 YooAsset_API/YooAsset_API_Reference_2.3.x.md create mode 100644 YooAsset_API/YooAsset_API_Reference_3.0.md diff --git a/YooAsset_API/YooAsset_API_Reference_2.3.x.md b/YooAsset_API/YooAsset_API_Reference_2.3.x.md new file mode 100644 index 0000000..18f2c97 --- /dev/null +++ b/YooAsset_API/YooAsset_API_Reference_2.3.x.md @@ -0,0 +1,7812 @@ +# YooAsset 2.3.x API Reference + +> Auto-generated from https://www.yooasset.com/docs/2.3.x/api/YooAsset/ +> Generated on 2026-06-09 16:49:39 + +--- +--- + +# Class AllAssetsHandle + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public sealed class AllAssetsHandle : HandleBase, IEnumerator, IDisposable + +``` + +## Properties + + +### AllAssetObjects + + +子资源对象集合 + +Declaration +```csharp +public IReadOnlyList AllAssetObjects { get; } + +``` + +## Methods + + +### WaitForAsyncComplete() + + +等待异步执行完毕 + +Declaration +```csharp +public void WaitForAsyncComplete() + +``` + +## Events + + +### Completed + + +完成委托 + +Declaration +```csharp +public event Action Completed + +``` + +##### Event Type + + +``System.Action`` + + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IDisposable`` +--- + +# Class AssetHandle + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public sealed class AssetHandle : HandleBase, IEnumerator, IDisposable + +``` + +## Properties + + +### AssetObject + + +资源对象 + +Declaration +```csharp +public Object AssetObject { get; } + +``` + +## Methods + + +### WaitForAsyncComplete() + + +等待异步执行完毕 + +Declaration +```csharp +public void WaitForAsyncComplete() + +``` + +### GetAssetObject() + + +获取资源对象 + +Declaration +```csharp +public TAsset GetAssetObject() where TAsset : Object + +``` + +##### Returns + + +```` + + +##### Type Parameters + +NameDescription``TAsset``资源类型 + +### InstantiateSync() + + +同步初始化游戏对象 + +Declaration +```csharp +public GameObject InstantiateSync() + +``` + +##### Returns + + +``UnityEngine.GameObject`` + + +### InstantiateSync(Transform) + +Declaration +```csharp +public GameObject InstantiateSync(Transform parent) + +``` + +##### Returns + + +``UnityEngine.GameObject`` + + +##### Parameters + +TypeName``UnityEngine.Transform``*parent* + +### InstantiateSync(Transform, bool) + +Declaration +```csharp +public GameObject InstantiateSync(Transform parent, bool worldPositionStays) + +``` + +##### Returns + + +``UnityEngine.GameObject`` + + +##### Parameters + +TypeName``UnityEngine.Transform``*parent*``System.Boolean``*worldPositionStays* + +### InstantiateSync(Vector3, Quaternion) + +Declaration +```csharp +public GameObject InstantiateSync(Vector3 position, Quaternion rotation) + +``` + +##### Returns + + +``UnityEngine.GameObject`` + + +##### Parameters + +TypeName``UnityEngine.Vector3``*position*``UnityEngine.Quaternion``*rotation* + +### InstantiateSync(Vector3, Quaternion, Transform) + +Declaration +```csharp +public GameObject InstantiateSync(Vector3 position, Quaternion rotation, Transform parent) + +``` + +##### Returns + + +``UnityEngine.GameObject`` + + +##### Parameters + +TypeName``UnityEngine.Vector3``*position*``UnityEngine.Quaternion``*rotation*``UnityEngine.Transform``*parent* + +### InstantiateAsync(bool) + + +异步初始化游戏对象 + +Declaration +```csharp +public InstantiateOperation InstantiateAsync(bool actived = true) + +``` + +##### Returns + + +[YooAsset.InstantiateOperation](/docs/2.3.x/api/YooAsset/InstantiateOperation) + + +##### Parameters + +TypeName``System.Boolean``*actived* + +### InstantiateAsync(Transform, bool) + +Declaration +```csharp +public InstantiateOperation InstantiateAsync(Transform parent, bool actived = true) + +``` + +##### Returns + + +[YooAsset.InstantiateOperation](/docs/2.3.x/api/YooAsset/InstantiateOperation) + + +##### Parameters + +TypeName``UnityEngine.Transform``*parent*``System.Boolean``*actived* + +### InstantiateAsync(Transform, bool, bool) + +Declaration +```csharp +public InstantiateOperation InstantiateAsync(Transform parent, bool worldPositionStays, bool actived = true) + +``` + +##### Returns + + +[YooAsset.InstantiateOperation](/docs/2.3.x/api/YooAsset/InstantiateOperation) + + +##### Parameters + +TypeName``UnityEngine.Transform``*parent*``System.Boolean``*worldPositionStays*``System.Boolean``*actived* + +### InstantiateAsync(Vector3, Quaternion, bool) + +Declaration +```csharp +public InstantiateOperation InstantiateAsync(Vector3 position, Quaternion rotation, bool actived = true) + +``` + +##### Returns + + +[YooAsset.InstantiateOperation](/docs/2.3.x/api/YooAsset/InstantiateOperation) + + +##### Parameters + +TypeName``UnityEngine.Vector3``*position*``UnityEngine.Quaternion``*rotation*``System.Boolean``*actived* + +### InstantiateAsync(Vector3, Quaternion, Transform, bool) + +Declaration +```csharp +public InstantiateOperation InstantiateAsync(Vector3 position, Quaternion rotation, Transform parent, bool actived = true) + +``` + +##### Returns + + +[YooAsset.InstantiateOperation](/docs/2.3.x/api/YooAsset/InstantiateOperation) + + +##### Parameters + +TypeName``UnityEngine.Vector3``*position*``UnityEngine.Quaternion``*rotation*``UnityEngine.Transform``*parent*``System.Boolean``*actived* + +## Events + + +### Completed + + +完成委托 + +Declaration +```csharp +public event Action Completed + +``` + +##### Event Type + + +``System.Action`` + + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IDisposable`` +--- + +# Class AssetInfo + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public class AssetInfo + +``` + +## Properties + + +### PackageName + + +所属包裹 + +Declaration +```csharp +public string PackageName { get; } + +``` + +### AssetType + + +资源类型 + +Declaration +```csharp +public Type AssetType { get; } + +``` + +### Error + + +错误信息 + +Declaration +```csharp +public string Error { get; } + +``` + +### IsInvalid + + +身份是否无效 + +Declaration +```csharp +public bool IsInvalid { get; } + +``` + +### Address + + +可寻址地址 + +Declaration +```csharp +public string Address { get; } + +``` + +### AssetPath + + +资源路径 + +Declaration +```csharp +public string AssetPath { get; } + +``` +--- + +# Class AsyncOperationBase + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public abstract class AsyncOperationBase : IEnumerator, IComparable + +``` + +## Properties + + +### Priority + + +任务优先级 + +Declaration +```csharp +public uint Priority { get; set; } + +``` + +### Status + + +任务状态 + +Declaration +```csharp +public EOperationStatus Status { get; protected set; } + +``` + +### Error + + +错误信息 + +Declaration +```csharp +public string Error { get; protected set; } + +``` + +### Progress + + +处理进度 + +Declaration +```csharp +public float Progress { get; protected set; } + +``` + +### PackageName + + +所属包裹名称 + +Declaration +```csharp +public string PackageName { get; } + +``` + +### IsDone + + +是否已经完成 + +Declaration +```csharp +public bool IsDone { get; } + +``` + +### Task + + +异步操作任务 + +Declaration +```csharp +public Task Task { get; } + +``` + +### ProcessTime + + +处理耗时(单位:毫秒) + +Declaration +```csharp +public long ProcessTime { get; protected set; } + +``` + +## Fields + + +### BeginTime + + +开始的时间 + +Declaration +```csharp +public string BeginTime + +``` + +## Methods + + +### ExecuteWhileDone() + + +执行While循环 + +Declaration +```csharp +protected bool ExecuteWhileDone() + +``` + +##### Returns + + +``System.Boolean`` + + +### ClearCompletedCallback() + + +清空完成回调 + +Declaration +```csharp +protected void ClearCompletedCallback() + +``` + +### WaitForAsyncComplete() + + +等待异步执行完毕 + +Declaration +```csharp +public void WaitForAsyncComplete() + +``` + +### CompareTo(AsyncOperationBase) + +Declaration +```csharp +public int CompareTo(AsyncOperationBase other) + +``` + +##### Returns + + +``System.Int32`` + + +##### Parameters + +TypeName[YooAsset.AsyncOperationBase](/docs/2.3.x/api/YooAsset/AsyncOperationBase)*other* + +## Events + + +### Completed + + +完成事件 + +Declaration +```csharp +public event Action Completed + +``` + +##### Event Type + + +``System.Action`` + + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IComparable`` +--- + +# Class ClearCacheFilesOperation + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public sealed class ClearCacheFilesOperation : AsyncOperationBase, IEnumerator, IComparable + +``` + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IComparable`` +--- + +# Class CustomPlayModeParameters + + +自定义运行模式的初始化参数 + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public class CustomPlayModeParameters : InitializeParameters + +``` + +## Fields + + +### FileSystemParameterList + + +文件系统初始化参数列表 +注意:列表最后一个元素作为主文件系统! + +Declaration +```csharp +public readonly List FileSystemParameterList + +``` +--- + +# Struct DecryptFileInfo + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public struct DecryptFileInfo + +``` + +## Fields + + +### BundleName + + +资源包名称 + +Declaration +```csharp +public string BundleName + +``` + +### FileLoadPath + + +文件加载路径 + +Declaration +```csharp +public string FileLoadPath + +``` + +### FileLoadCRC + + +Unity引擎用于内容校验的CRC + +Declaration +```csharp +public uint FileLoadCRC + +``` +--- + +# Struct DecryptResult + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public struct DecryptResult + +``` + +## Fields + + +### Result + + +资源包对象 + +Declaration +```csharp +public AssetBundle Result + +``` + +### CreateRequest + + +异步请求句柄 + +Declaration +```csharp +public AssetBundleCreateRequest CreateRequest + +``` + +### ManagedStream + + +托管流对象 +注意:流对象在资源包对象释放的时候会自动释放 + +Declaration +```csharp +public Stream ManagedStream + +``` +--- + +# Class DestroyOperation + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public class DestroyOperation : AsyncOperationBase, IEnumerator, IComparable + +``` + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IComparable`` +--- + +# Struct DownloaderFinishData + + +下载器结束 + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public struct DownloaderFinishData + +``` + +## Fields + + +### PackageName + + +所属包裹名称 + +Declaration +```csharp +public string PackageName + +``` + +### Succeed + + +是否成功 + +Declaration +```csharp +public bool Succeed + +``` +--- + +# Class DownloaderOperation + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public abstract class DownloaderOperation : AsyncOperationBase, IEnumerator, IComparable + +``` + +## Properties + + +### TotalDownloadCount + + +统计的下载文件总数量 + +Declaration +```csharp +public int TotalDownloadCount { get; } + +``` + +### TotalDownloadBytes + + +统计的下载文件的总大小 + +Declaration +```csharp +public long TotalDownloadBytes { get; } + +``` + +### CurrentDownloadCount + + +当前已经完成的下载总数量 + +Declaration +```csharp +public int CurrentDownloadCount { get; } + +``` + +### CurrentDownloadBytes + + +当前已经完成的下载总大小 + +Declaration +```csharp +public long CurrentDownloadBytes { get; } + +``` + +### DownloadFinishCallback + + +当下载器结束(无论成功或失败) + +Declaration +```csharp +public DownloaderOperation.DownloaderFinish DownloadFinishCallback { get; set; } + +``` + +### DownloadUpdateCallback + + +当下载进度发生变化 + +Declaration +```csharp +public DownloaderOperation.DownloadUpdate DownloadUpdateCallback { get; set; } + +``` + +### DownloadErrorCallback + + +当下载器发生错误 + +Declaration +```csharp +public DownloaderOperation.DownloadError DownloadErrorCallback { get; set; } + +``` + +### DownloadFileBeginCallback + + +当开始下载某个文件 + +Declaration +```csharp +public DownloaderOperation.DownloadFileBegin DownloadFileBeginCallback { get; set; } + +``` + +## Methods + + +### Combine(DownloaderOperation) + + +合并其它下载器 + +Declaration +```csharp +public void Combine(DownloaderOperation downloader) + +``` + +##### Parameters + +TypeNameDescription[YooAsset.DownloaderOperation](/docs/2.3.x/api/YooAsset/DownloaderOperation)*downloader*合并的下载器 + +### BeginDownload() + + +开始下载 + +Declaration +```csharp +public void BeginDownload() + +``` + +### PauseDownload() + + +暂停下载 + +Declaration +```csharp +public void PauseDownload() + +``` + +### ResumeDownload() + + +恢复下载 + +Declaration +```csharp +public void ResumeDownload() + +``` + +### CancelDownload() + + +取消下载 + +Declaration +```csharp +public void CancelDownload() + +``` + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IComparable`` +--- + +# Delegate DownloaderOperation.DownloaderFinish + + +下载器结束 + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public delegate void DownloaderOperation.DownloaderFinish(DownloaderFinishData data) + +``` +--- + +# Delegate DownloaderOperation.DownloadError + + +下载发生错误 + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public delegate void DownloaderOperation.DownloadError(DownloadErrorData data) + +``` +--- + +# Delegate DownloaderOperation.DownloadFileBegin + + +开始下载某个文件 + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public delegate void DownloaderOperation.DownloadFileBegin(DownloadFileData data) + +``` +--- + +# Delegate DownloaderOperation.DownloadUpdate + + +下载进度更新 + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public delegate void DownloaderOperation.DownloadUpdate(DownloadUpdateData data) + +``` +--- + +# Struct DownloadErrorData + + +下载器相关的错误数据 + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public struct DownloadErrorData + +``` + +## Fields + + +### PackageName + + +所属包裹名称 + +Declaration +```csharp +public string PackageName + +``` + +### FileName + + +下载失败的文件名称 + +Declaration +```csharp +public string FileName + +``` + +### ErrorInfo + + +错误信息 + +Declaration +```csharp +public string ErrorInfo + +``` +--- + +# Struct DownloadFileData + + +下载器相关的文件数据 + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public struct DownloadFileData + +``` + +## Fields + + +### PackageName + + +所属包裹名称 + +Declaration +```csharp +public string PackageName + +``` + +### FileName + + +下载的文件名称 + +Declaration +```csharp +public string FileName + +``` + +### FileSize + + +下载的文件大小 + +Declaration +```csharp +public long FileSize + +``` +--- + +# Struct DownloadStatus + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public struct DownloadStatus + +``` + +## Fields + + +### IsDone + + +下载是否已经完成 + +Declaration +```csharp +public bool IsDone + +``` + +### Progress + + +下载进度(0-1f) + +Declaration +```csharp +public float Progress + +``` + +### TotalBytes + + +下载文件的总大小 + +Declaration +```csharp +public long TotalBytes + +``` + +### DownloadedBytes + + +已经下载的文件大小 + +Declaration +```csharp +public long DownloadedBytes + +``` + +## Methods + + +### CreateDefaultStatus() + +Declaration +```csharp +public static DownloadStatus CreateDefaultStatus() + +``` + +##### Returns + + +[YooAsset.DownloadStatus](/docs/2.3.x/api/YooAsset/DownloadStatus) +--- + +# Struct DownloadUpdateData + + +下载器相关的更新数据 + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public struct DownloadUpdateData + +``` + +## Fields + + +### PackageName + + +所属包裹名称 + +Declaration +```csharp +public string PackageName + +``` + +### Progress + + +下载进度 (0-1f) + +Declaration +```csharp +public float Progress + +``` + +### TotalDownloadCount + + +下载文件总数 + +Declaration +```csharp +public int TotalDownloadCount + +``` + +### CurrentDownloadCount + + +当前完成的下载文件数量 + +Declaration +```csharp +public int CurrentDownloadCount + +``` + +### TotalDownloadBytes + + +下载数据总大小(单位:字节) + +Declaration +```csharp +public long TotalDownloadBytes + +``` + +### CurrentDownloadBytes + + +当前完成的下载数据大小(单位:字节) + +Declaration +```csharp +public long CurrentDownloadBytes + +``` +--- + +# Enum EBuildBundleType + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public enum EBuildBundleType + +``` + +## Fields + + +### Unknown + + +未知类型 + +Declaration +```csharp +Unknown = 0 + +``` + +### VirtualBundle + + +虚拟资源包 + +Declaration +```csharp +VirtualBundle = 1 + +``` + +### AssetBundle + + +AssetBundle + +Declaration +```csharp +AssetBundle = 2 + +``` + +### RawBundle + + +原生文件 + +Declaration +```csharp +RawBundle = 3 + +``` +--- + +# Class EditorSimulateModeHelper + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public class EditorSimulateModeHelper + +``` + +## Methods + + +### SimulateBuild(string) + +Declaration +```csharp +public static PackageInvokeBuildResult SimulateBuild(string packageName) + +``` + +##### Returns + + +[YooAsset.PackageInvokeBuildResult](/docs/2.3.x/api/YooAsset/PackageInvokeBuildResult) + + +##### Parameters + +TypeName``System.String``*packageName* +--- + +# Class EditorSimulateModeParameters + + +编辑器下模拟运行模式的初始化参数 + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public class EditorSimulateModeParameters : InitializeParameters + +``` + +## Fields + + +### EditorFileSystemParameters + +Declaration +```csharp +public FileSystemParameters EditorFileSystemParameters + +``` +--- + +# Enum EFileClearMode + + +文件清理方式 + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public enum EFileClearMode + +``` + +## Fields + + +### ClearAllBundleFiles + + +清理所有文件 + +Declaration +```csharp +ClearAllBundleFiles = 0 + +``` + +### ClearUnusedBundleFiles + + +清理未在使用的文件 + +Declaration +```csharp +ClearUnusedBundleFiles = 1 + +``` + +### ClearBundleFilesByTags + +Declaration +```csharp +ClearBundleFilesByTags = 2 + +``` + +### ClearAllManifestFiles + + +清理所有清单 + +Declaration +```csharp +ClearAllManifestFiles = 3 + +``` + +### ClearUnusedManifestFiles + + +清理未在使用的清单 + +Declaration +```csharp +ClearUnusedManifestFiles = 4 + +``` +--- + +# Enum EFileNameStyle + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public enum EFileNameStyle + +``` + +## Fields + + +### HashName + + +哈希值名称 + +Declaration +```csharp +HashName = 0 + +``` + +### BundleName + + +资源包名称(不推荐) + +Declaration +```csharp +BundleName = 1 + +``` + +### BundleName_HashName + + +资源包名称 + 哈希值名称 + +Declaration +```csharp +BundleName_HashName = 2 + +``` +--- + +# Enum EFileVerifyLevel + + +文件校验等级 + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public enum EFileVerifyLevel + +``` + +## Fields + + +### Low + + +验证文件存在 + +Declaration +```csharp +Low = 1 + +``` + +### Middle + + +验证文件大小 + +Declaration +```csharp +Middle = 2 + +``` + +### High + + +验证文件大小和CRC + +Declaration +```csharp +High = 3 + +``` +--- + +# Struct EncryptFileInfo + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public struct EncryptFileInfo + +``` + +## Fields + + +### BundleName + + +资源包名称 + +Declaration +```csharp +public string BundleName + +``` + +### FileLoadPath + + +文件路径 + +Declaration +```csharp +public string FileLoadPath + +``` +--- + +# Struct EncryptResult + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public struct EncryptResult + +``` + +## Fields + + +### Encrypted + + +文件是否加密 + +Declaration +```csharp +public bool Encrypted + +``` + +### EncryptedData + + +加密后的文件数据 + +Declaration +```csharp +public byte[] EncryptedData + +``` +--- + +# Enum EOperationStatus + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public enum EOperationStatus + +``` + +## Fields + + +### None + +Declaration +```csharp +None = 0 + +``` + +### Processing + +Declaration +```csharp +Processing = 1 + +``` + +### Succeed + +Declaration +```csharp +Succeed = 2 + +``` + +### Failed + +Declaration +```csharp +Failed = 3 + +``` +--- + +# Enum EOverwriteInstallClearMode + + +覆盖安装清理模式 + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public enum EOverwriteInstallClearMode + +``` + +## Fields + + +### None + + +不做任何处理 + +Declaration +```csharp +None = 0 + +``` + +### ClearAllCacheFiles + + +清理所有缓存文件(包含资源文件和清单文件) + +Declaration +```csharp +ClearAllCacheFiles = 1 + +``` + +### ClearAllBundleFiles + + +清理所有缓存的资源文件 + +Declaration +```csharp +ClearAllBundleFiles = 2 + +``` + +### ClearAllManifestFiles + + +清理所有缓存的清单文件 + +Declaration +```csharp +ClearAllManifestFiles = 3 + +``` +--- + +# Enum EPlayMode + + +运行模式 + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public enum EPlayMode + +``` + +## Fields + + +### EditorSimulateMode + + +编辑器下的模拟模式 + +Declaration +```csharp +EditorSimulateMode = 0 + +``` + +### OfflinePlayMode + + +离线运行模式 + +Declaration +```csharp +OfflinePlayMode = 1 + +``` + +### HostPlayMode + + +联机运行模式 + +Declaration +```csharp +HostPlayMode = 2 + +``` + +### WebPlayMode + + +WebGL运行模式 + +Declaration +```csharp +WebPlayMode = 3 + +``` + +### CustomPlayMode + + +自定义运行模式 + +Declaration +```csharp +CustomPlayMode = 4 + +``` +--- + +# Class FileSystemParameters + + +文件系统参数 + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public class FileSystemParameters + +``` + +## Properties + + +### FileSystemClass + + +文件系统类 +格式: "namespace.class,assembly" +格式: "命名空间.类型名,程序集" + +Declaration +```csharp +public string FileSystemClass { get; } + +``` + +### PackageRoot + + +文件系统的根目录 + +Declaration +```csharp +public string PackageRoot { get; } + +``` + +## Methods + + +### AddParameter(string, object) + + +添加自定义参数 + +Declaration +```csharp +public void AddParameter(string name, object value) + +``` + +##### Parameters + +TypeName``System.String``*name*``System.Object``*value* + +### CreateDefaultEditorFileSystemParameters(string) + + +创建默认的编辑器文件系统参数 +文件系统的根目录 + +Declaration +```csharp +public static FileSystemParameters CreateDefaultEditorFileSystemParameters(string packageRoot) + +``` + +##### Returns + + +[YooAsset.FileSystemParameters](/docs/2.3.x/api/YooAsset/FileSystemParameters) + + +##### Parameters + +TypeName``System.String``*packageRoot* + +### CreateDefaultBuildinFileSystemParameters(IDecryptionServices, string) + + +创建默认的内置文件系统参数 + +Declaration +```csharp +public static FileSystemParameters CreateDefaultBuildinFileSystemParameters(IDecryptionServices decryptionServices = null, string packageRoot = null) + +``` + +##### Returns + + +[YooAsset.FileSystemParameters](/docs/2.3.x/api/YooAsset/FileSystemParameters) + + +##### Parameters + +TypeNameDescription[YooAsset.IDecryptionServices](/docs/2.3.x/api/YooAsset/IDecryptionServices)*decryptionServices*加密文件解密服务类``System.String``*packageRoot*文件系统的根目录 + +### CreateDefaultCacheFileSystemParameters(IRemoteServices, IDecryptionServices, string) + + +创建默认的缓存文件系统参数 + +Declaration +```csharp +public static FileSystemParameters CreateDefaultCacheFileSystemParameters(IRemoteServices remoteServices, IDecryptionServices decryptionServices = null, string packageRoot = null) + +``` + +##### Returns + + +[YooAsset.FileSystemParameters](/docs/2.3.x/api/YooAsset/FileSystemParameters) + + +##### Parameters + +TypeNameDescription[YooAsset.IRemoteServices](/docs/2.3.x/api/YooAsset/IRemoteServices)*remoteServices*远端资源地址查询服务类[YooAsset.IDecryptionServices](/docs/2.3.x/api/YooAsset/IDecryptionServices)*decryptionServices*加密文件解密服务类``System.String``*packageRoot*文件系统的根目录 + +### CreateDefaultWebServerFileSystemParameters(IWebDecryptionServices, bool) + + +创建默认的WebServer文件系统参数 + +Declaration +```csharp +public static FileSystemParameters CreateDefaultWebServerFileSystemParameters(IWebDecryptionServices decryptionServices = null, bool disableUnityWebCache = false) + +``` + +##### Returns + + +[YooAsset.FileSystemParameters](/docs/2.3.x/api/YooAsset/FileSystemParameters) + + +##### Parameters + +TypeNameDescription[YooAsset.IWebDecryptionServices](/docs/2.3.x/api/YooAsset/IWebDecryptionServices)*decryptionServices*加密文件解密服务类``System.Boolean``*disableUnityWebCache*禁用Unity的网络缓存 + +### CreateDefaultWebRemoteFileSystemParameters(IRemoteServices, IWebDecryptionServices, bool) + + +创建默认的WebRemote文件系统参数 + +Declaration +```csharp +public static FileSystemParameters CreateDefaultWebRemoteFileSystemParameters(IRemoteServices remoteServices, IWebDecryptionServices decryptionServices = null, bool disableUnityWebCache = false) + +``` + +##### Returns + + +[YooAsset.FileSystemParameters](/docs/2.3.x/api/YooAsset/FileSystemParameters) + + +##### Parameters + +TypeNameDescription[YooAsset.IRemoteServices](/docs/2.3.x/api/YooAsset/IRemoteServices)*remoteServices*远端资源地址查询服务类[YooAsset.IWebDecryptionServices](/docs/2.3.x/api/YooAsset/IWebDecryptionServices)*decryptionServices*加密文件解密服务类``System.Boolean``*disableUnityWebCache*禁用Unity的网络缓存 +--- + +# Class FileSystemParametersDefine + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public class FileSystemParametersDefine + +``` + +## Fields + + +### FILE_VERIFY_LEVEL + +Declaration +```csharp +public const string FILE_VERIFY_LEVEL = "FILE_VERIFY_LEVEL" + +``` + +### FILE_VERIFY_MAX_CONCURRENCY + +Declaration +```csharp +public const string FILE_VERIFY_MAX_CONCURRENCY = "FILE_VERIFY_MAX_CONCURRENCY" + +``` + +### INSTALL_CLEAR_MODE + +Declaration +```csharp +public const string INSTALL_CLEAR_MODE = "INSTALL_CLEAR_MODE" + +``` + +### REMOTE_SERVICES + +Declaration +```csharp +public const string REMOTE_SERVICES = "REMOTE_SERVICES" + +``` + +### DECRYPTION_SERVICES + +Declaration +```csharp +public const string DECRYPTION_SERVICES = "DECRYPTION_SERVICES" + +``` + +### MANIFEST_SERVICES + +Declaration +```csharp +public const string MANIFEST_SERVICES = "MANIFEST_SERVICES" + +``` + +### APPEND_FILE_EXTENSION + +Declaration +```csharp +public const string APPEND_FILE_EXTENSION = "APPEND_FILE_EXTENSION" + +``` + +### DISABLE_CATALOG_FILE + +Declaration +```csharp +public const string DISABLE_CATALOG_FILE = "DISABLE_CATALOG_FILE" + +``` + +### DISABLE_UNITY_WEB_CACHE + +Declaration +```csharp +public const string DISABLE_UNITY_WEB_CACHE = "DISABLE_UNITY_WEB_CACHE" + +``` + +### DISABLE_ONDEMAND_DOWNLOAD + +Declaration +```csharp +public const string DISABLE_ONDEMAND_DOWNLOAD = "DISABLE_ONDEMAND_DOWNLOAD" + +``` + +### DOWNLOAD_MAX_CONCURRENCY + +Declaration +```csharp +public const string DOWNLOAD_MAX_CONCURRENCY = "DOWNLOAD_MAX_CONCURRENCY" + +``` + +### DOWNLOAD_MAX_REQUEST_PER_FRAME + +Declaration +```csharp +public const string DOWNLOAD_MAX_REQUEST_PER_FRAME = "DOWNLOAD_MAX_REQUEST_PER_FRAME" + +``` + +### DOWNLOAD_WATCH_DOG_TIME + +Declaration +```csharp +public const string DOWNLOAD_WATCH_DOG_TIME = "DOWNLOAD_WATCH_DOG_TIME" + +``` + +### RESUME_DOWNLOAD_MINMUM_SIZE + +Declaration +```csharp +public const string RESUME_DOWNLOAD_MINMUM_SIZE = "RESUME_DOWNLOAD_MINMUM_SIZE" + +``` + +### RESUME_DOWNLOAD_RESPONSE_CODES + +Declaration +```csharp +public const string RESUME_DOWNLOAD_RESPONSE_CODES = "RESUME_DOWNLOAD_RESPONSE_CODES" + +``` + +### VIRTUAL_WEBGL_MODE + +Declaration +```csharp +public const string VIRTUAL_WEBGL_MODE = "VIRTUAL_WEBGL_MODE" + +``` + +### VIRTUAL_DOWNLOAD_MODE + +Declaration +```csharp +public const string VIRTUAL_DOWNLOAD_MODE = "VIRTUAL_DOWNLOAD_MODE" + +``` + +### VIRTUAL_DOWNLOAD_SPEED + +Declaration +```csharp +public const string VIRTUAL_DOWNLOAD_SPEED = "VIRTUAL_DOWNLOAD_SPEED" + +``` + +### ASYNC_SIMULATE_MIN_FRAME + +Declaration +```csharp +public const string ASYNC_SIMULATE_MIN_FRAME = "ASYNC_SIMULATE_MIN_FRAME" + +``` + +### ASYNC_SIMULATE_MAX_FRAME + +Declaration +```csharp +public const string ASYNC_SIMULATE_MAX_FRAME = "ASYNC_SIMULATE_MAX_FRAME" + +``` + +### COPY_BUILDIN_PACKAGE_MANIFEST + +Declaration +```csharp +public const string COPY_BUILDIN_PACKAGE_MANIFEST = "COPY_BUILDIN_PACKAGE_MANIFEST" + +``` + +### COPY_BUILDIN_PACKAGE_MANIFEST_DEST_ROOT + +Declaration +```csharp +public const string COPY_BUILDIN_PACKAGE_MANIFEST_DEST_ROOT = "COPY_BUILDIN_PACKAGE_MANIFEST_DEST_ROOT" + +``` + +### COPY_LOCAL_FILE_SERVICES + +Declaration +```csharp +public const string COPY_LOCAL_FILE_SERVICES = "COPY_LOCAL_FILE_SERVICES" + +``` +--- + +# Class GameAsyncOperation + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public abstract class GameAsyncOperation : AsyncOperationBase, IEnumerator, IComparable + +``` + +## Methods + + +### OnStart() + + +异步操作开始 + +Declaration +```csharp +protected abstract void OnStart() + +``` + +### OnUpdate() + + +异步操作更新 + +Declaration +```csharp +protected abstract void OnUpdate() + +``` + +### OnAbort() + + +异步操作终止 + +Declaration +```csharp +protected abstract void OnAbort() + +``` + +### OnWaitForAsyncComplete() + + +异步等待完成 + +Declaration +```csharp +protected virtual void OnWaitForAsyncComplete() + +``` + +### IsBusy() + + +异步操作系统是否繁忙 + +Declaration +```csharp +protected bool IsBusy() + +``` + +##### Returns + + +``System.Boolean`` + + +### Abort() + + +终止异步操作 + +Declaration +```csharp +protected void Abort() + +``` + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IComparable`` +--- + +# Class HandleBase + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public abstract class HandleBase : IEnumerator, IDisposable + +``` + +## Properties + + +### Status + + +当前状态 + +Declaration +```csharp +public EOperationStatus Status { get; } + +``` + +### LastError + + +最近的错误信息 + +Declaration +```csharp +public string LastError { get; } + +``` + +### Progress + + +加载进度 + +Declaration +```csharp +public float Progress { get; } + +``` + +### IsDone + + +是否加载完毕 + +Declaration +```csharp +public bool IsDone { get; } + +``` + +### IsValid + + +句柄是否有效 + +Declaration +```csharp +public bool IsValid { get; } + +``` + +### Task + + +异步操作任务 + +Declaration +```csharp +public Task Task { get; } + +``` + +## Methods + + +### Release() + + +释放资源句柄 + +Declaration +```csharp +public void Release() + +``` + +### Dispose() + + +释放资源句柄 + +Declaration +```csharp +public void Dispose() + +``` + +### GetAssetInfo() + + +获取资源信息 + +Declaration +```csharp +public AssetInfo GetAssetInfo() + +``` + +##### Returns + + +[YooAsset.AssetInfo](/docs/2.3.x/api/YooAsset/AssetInfo) + + +### GetDownloadStatus() + + +获取下载报告 + +Declaration +```csharp +public DownloadStatus GetDownloadStatus() + +``` + +##### Returns + + +[YooAsset.DownloadStatus](/docs/2.3.x/api/YooAsset/DownloadStatus) + + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IDisposable`` +--- + +# Class HashUtility + + +哈希工具类 + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public static class HashUtility + +``` + +## Methods + + +### StringSHA1(string) + + +获取字符串的Hash值 + +Declaration +```csharp +public static string StringSHA1(string str) + +``` + +##### Returns + + +``System.String`` + + +##### Parameters + +TypeName``System.String``*str* + +### FileSHA1(string) + + +获取文件的Hash值 + +Declaration +```csharp +public static string FileSHA1(string filePath) + +``` + +##### Returns + + +``System.String`` + + +##### Parameters + +TypeName``System.String``*filePath* + +### FileSHA1Safely(string) + + +获取文件的Hash值 + +Declaration +```csharp +public static string FileSHA1Safely(string filePath) + +``` + +##### Returns + + +``System.String`` + + +##### Parameters + +TypeName``System.String``*filePath* + +### StreamSHA1(Stream) + + +获取数据流的Hash值 + +Declaration +```csharp +public static string StreamSHA1(Stream stream) + +``` + +##### Returns + + +``System.String`` + + +##### Parameters + +TypeName``System.IO.Stream``*stream* + +### BytesSHA1(byte[]) + + +获取字节数组的Hash值 + +Declaration +```csharp +public static string BytesSHA1(byte[] buffer) + +``` + +##### Returns + + +``System.String`` + + +##### Parameters + +TypeName``System.Byte[]``*buffer* + +### StringMD5(string) + + +获取字符串的MD5 + +Declaration +```csharp +public static string StringMD5(string str) + +``` + +##### Returns + + +``System.String`` + + +##### Parameters + +TypeName``System.String``*str* + +### FileMD5(string) + + +获取文件的MD5 + +Declaration +```csharp +public static string FileMD5(string filePath) + +``` + +##### Returns + + +``System.String`` + + +##### Parameters + +TypeName``System.String``*filePath* + +### FileMD5Safely(string) + + +获取文件的MD5 + +Declaration +```csharp +public static string FileMD5Safely(string filePath) + +``` + +##### Returns + + +``System.String`` + + +##### Parameters + +TypeName``System.String``*filePath* + +### StreamMD5(Stream) + + +获取数据流的MD5 + +Declaration +```csharp +public static string StreamMD5(Stream stream) + +``` + +##### Returns + + +``System.String`` + + +##### Parameters + +TypeName``System.IO.Stream``*stream* + +### BytesMD5(byte[]) + + +获取字节数组的MD5 + +Declaration +```csharp +public static string BytesMD5(byte[] buffer) + +``` + +##### Returns + + +``System.String`` + + +##### Parameters + +TypeName``System.Byte[]``*buffer* + +### StringCRC32(string) + + +获取字符串的CRC32 + +Declaration +```csharp +public static string StringCRC32(string str) + +``` + +##### Returns + + +``System.String`` + + +##### Parameters + +TypeName``System.String``*str* + +### StringCRC32Value(string) + +Declaration +```csharp +public static uint StringCRC32Value(string str) + +``` + +##### Returns + + +``System.UInt32`` + + +##### Parameters + +TypeName``System.String``*str* + +### FileCRC32(string) + + +获取文件的CRC32 + +Declaration +```csharp +public static string FileCRC32(string filePath) + +``` + +##### Returns + + +``System.String`` + + +##### Parameters + +TypeName``System.String``*filePath* + +### FileCRC32Value(string) + +Declaration +```csharp +public static uint FileCRC32Value(string filePath) + +``` + +##### Returns + + +``System.UInt32`` + + +##### Parameters + +TypeName``System.String``*filePath* + +### FileCRC32Safely(string) + + +获取文件的CRC32 + +Declaration +```csharp +public static string FileCRC32Safely(string filePath) + +``` + +##### Returns + + +``System.String`` + + +##### Parameters + +TypeName``System.String``*filePath* + +### FileCRC32ValueSafely(string) + +Declaration +```csharp +public static uint FileCRC32ValueSafely(string filePath) + +``` + +##### Returns + + +``System.UInt32`` + + +##### Parameters + +TypeName``System.String``*filePath* + +### StreamCRC32(Stream) + + +获取数据流的CRC32 + +Declaration +```csharp +public static string StreamCRC32(Stream stream) + +``` + +##### Returns + + +``System.String`` + + +##### Parameters + +TypeName``System.IO.Stream``*stream* + +### StreamCRC32Value(Stream) + +Declaration +```csharp +public static uint StreamCRC32Value(Stream stream) + +``` + +##### Returns + + +``System.UInt32`` + + +##### Parameters + +TypeName``System.IO.Stream``*stream* + +### BytesCRC32(byte[]) + + +获取字节数组的CRC32 + +Declaration +```csharp +public static string BytesCRC32(byte[] buffer) + +``` + +##### Returns + + +``System.String`` + + +##### Parameters + +TypeName``System.Byte[]``*buffer* + +### BytesCRC32Value(byte[]) + +Declaration +```csharp +public static uint BytesCRC32Value(byte[] buffer) + +``` + +##### Returns + + +``System.UInt32`` + + +##### Parameters + +TypeName``System.Byte[]``*buffer* +--- + +# Class HostPlayModeParameters + + +联机运行模式的初始化参数 + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public class HostPlayModeParameters : InitializeParameters + +``` + +## Fields + + +### BuildinFileSystemParameters + +Declaration +```csharp +public FileSystemParameters BuildinFileSystemParameters + +``` + +### CacheFileSystemParameters + +Declaration +```csharp +public FileSystemParameters CacheFileSystemParameters + +``` +--- + +# Interface ICopyLocalFileServices + + +本地文件拷贝服务类 +备注:包体内文件拷贝,沙盒内文件导入都会触发该服务! + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public interface ICopyLocalFileServices + +``` + +## Methods + + +### CopyFile(LocalFileInfo, string) + +Declaration +```csharp +void CopyFile(LocalFileInfo sourceFileInfo, string destFilePath) + +``` + +##### Parameters + +TypeName[YooAsset.LocalFileInfo](/docs/2.3.x/api/YooAsset/LocalFileInfo)*sourceFileInfo*``System.String``*destFilePath* +--- + +# Interface IDecryptionServices + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public interface IDecryptionServices + +``` + +## Methods + + +### LoadAssetBundle(DecryptFileInfo) + + +同步方式获取解密的资源包 + +Declaration +```csharp +DecryptResult LoadAssetBundle(DecryptFileInfo fileInfo) + +``` + +##### Returns + + +[YooAsset.DecryptResult](/docs/2.3.x/api/YooAsset/DecryptResult) + + +##### Parameters + +TypeName[YooAsset.DecryptFileInfo](/docs/2.3.x/api/YooAsset/DecryptFileInfo)*fileInfo* + +### LoadAssetBundleAsync(DecryptFileInfo) + + +异步方式获取解密的资源包 + +Declaration +```csharp +DecryptResult LoadAssetBundleAsync(DecryptFileInfo fileInfo) + +``` + +##### Returns + + +[YooAsset.DecryptResult](/docs/2.3.x/api/YooAsset/DecryptResult) + + +##### Parameters + +TypeName[YooAsset.DecryptFileInfo](/docs/2.3.x/api/YooAsset/DecryptFileInfo)*fileInfo* + +### LoadAssetBundleFallback(DecryptFileInfo) + + +后备方式获取解密的资源包 +注意:当正常解密方法失败后,会触发后备加载! +说明:建议通过LoadFromMemory()方法加载资源包作为保底机制。 +issues : [https://github.com/tuyoogame/YooAsset/issues/562](https://github.com/tuyoogame/YooAsset/issues/562) + +Declaration +```csharp +DecryptResult LoadAssetBundleFallback(DecryptFileInfo fileInfo) + +``` + +##### Returns + + +[YooAsset.DecryptResult](/docs/2.3.x/api/YooAsset/DecryptResult) + + +##### Parameters + +TypeName[YooAsset.DecryptFileInfo](/docs/2.3.x/api/YooAsset/DecryptFileInfo)*fileInfo* + +### ReadFileData(DecryptFileInfo) + + +获取解密的字节数据 + +Declaration +```csharp +byte[] ReadFileData(DecryptFileInfo fileInfo) + +``` + +##### Returns + + +``System.Byte[]`` + + +##### Parameters + +TypeName[YooAsset.DecryptFileInfo](/docs/2.3.x/api/YooAsset/DecryptFileInfo)*fileInfo* + +### ReadFileText(DecryptFileInfo) + + +获取解密的文本数据 + +Declaration +```csharp +string ReadFileText(DecryptFileInfo fileInfo) + +``` + +##### Returns + + +``System.String`` + + +##### Parameters + +TypeName[YooAsset.DecryptFileInfo](/docs/2.3.x/api/YooAsset/DecryptFileInfo)*fileInfo* +--- + +# Interface IEncryptionServices + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public interface IEncryptionServices + +``` + +## Methods + + +### Encrypt(EncryptFileInfo) + +Declaration +```csharp +EncryptResult Encrypt(EncryptFileInfo fileInfo) + +``` + +##### Returns + + +[YooAsset.EncryptResult](/docs/2.3.x/api/YooAsset/EncryptResult) + + +##### Parameters + +TypeName[YooAsset.EncryptFileInfo](/docs/2.3.x/api/YooAsset/EncryptFileInfo)*fileInfo* +--- + +# Interface ILogger + + +自定义日志处理 + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public interface ILogger + +``` + +## Methods + + +### Log(string) + +Declaration +```csharp +void Log(string message) + +``` + +##### Parameters + +TypeName``System.String``*message* + +### Warning(string) + +Declaration +```csharp +void Warning(string message) + +``` + +##### Parameters + +TypeName``System.String``*message* + +### Error(string) + +Declaration +```csharp +void Error(string message) + +``` + +##### Parameters + +TypeName``System.String``*message* + +### Exception(Exception) + +Declaration +```csharp +void Exception(Exception exception) + +``` + +##### Parameters + +TypeName``System.Exception``*exception* +--- + +# Interface IManifestProcessServices + + +资源清单文件处理服务接口 + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public interface IManifestProcessServices + +``` + +## Methods + + +### ProcessManifest(byte[]) + + +处理资源清单(压缩或加密) + +Declaration +```csharp +byte[] ProcessManifest(byte[] fileData) + +``` + +##### Returns + + +``System.Byte[]`` + + +##### Parameters + +TypeName``System.Byte[]``*fileData* +--- + +# Interface IManifestRestoreServices + + +资源清单文件处理服务接口 + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public interface IManifestRestoreServices + +``` + +## Methods + + +### RestoreManifest(byte[]) + + +还原资源清单(解压或解密) + +Declaration +```csharp +byte[] RestoreManifest(byte[] fileData) + +``` + +##### Returns + + +``System.Byte[]`` + + +##### Parameters + +TypeName``System.Byte[]``*fileData* +--- + +# Struct ImportFileInfo + + +导入文件的信息 + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public struct ImportFileInfo + +``` + +## Fields + + +### FilePath + + +本地文件路径 + +Declaration +```csharp +public string FilePath + +``` + +### BundleName + + +资源包名称 + +Declaration +```csharp +public string BundleName + +``` + +### BundleGUID + + +资源包GUID + +Declaration +```csharp +public string BundleGUID + +``` +--- + +# Class InitializationOperation + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public class InitializationOperation : AsyncOperationBase, IEnumerator, IComparable + +``` + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IComparable`` +--- + +# Class InitializeParameters + + +初始化参数 + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public abstract class InitializeParameters + +``` + +## Fields + + +### BundleLoadingMaxConcurrency + + +同时加载Bundle文件的最大并发数 + +Declaration +```csharp +public int BundleLoadingMaxConcurrency + +``` + +### WebGLForceSyncLoadAsset + + +WebGL平台强制同步加载资源对象 + +Declaration +```csharp +public bool WebGLForceSyncLoadAsset + +``` +--- + +# Class InstantiateOperation + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public sealed class InstantiateOperation : AsyncOperationBase, IEnumerator, IComparable + +``` + +## Fields + + +### Result + + +实例化的游戏对象 + +Declaration +```csharp +public GameObject Result + +``` + +## Methods + + +### Cancel() + + +取消实例化对象操作 + +Declaration +```csharp +public void Cancel() + +``` + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IComparable`` +--- + +# Interface IRemoteServices + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public interface IRemoteServices + +``` + +## Methods + + +### GetRemoteMainURL(string) + + +获取主资源站的资源地址 + +Declaration +```csharp +string GetRemoteMainURL(string fileName) + +``` + +##### Returns + + +``System.String`` + + +##### Parameters + +TypeNameDescription``System.String``*fileName*请求的文件名称 + +### GetRemoteFallbackURL(string) + + +获取备用资源站的资源地址 + +Declaration +```csharp +string GetRemoteFallbackURL(string fileName) + +``` + +##### Returns + + +``System.String`` + + +##### Parameters + +TypeNameDescription``System.String``*fileName*请求的文件名称 +--- + +# Interface IWebDecryptionServices + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public interface IWebDecryptionServices + +``` + +## Methods + + +### LoadAssetBundle(WebDecryptFileInfo) + +Declaration +```csharp +WebDecryptResult LoadAssetBundle(WebDecryptFileInfo fileInfo) + +``` + +##### Returns + + +[YooAsset.WebDecryptResult](/docs/2.3.x/api/YooAsset/WebDecryptResult) + + +##### Parameters + +TypeName[YooAsset.WebDecryptFileInfo](/docs/2.3.x/api/YooAsset/WebDecryptFileInfo)*fileInfo* +--- + +# Struct LocalFileInfo + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public struct LocalFileInfo + +``` + +## Fields + + +### PackageName + + +包裹名称 + +Declaration +```csharp +public string PackageName + +``` + +### BundleName + + +资源包名称 + +Declaration +```csharp +public string BundleName + +``` + +### SourceFileURL + + +源文件请求地址 + +Declaration +```csharp +public string SourceFileURL + +``` +--- + +# Class ManifestDefine + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public class ManifestDefine + +``` + +## Fields + + +### FileMaxSize + + +文件极限大小(100MB) + +Declaration +```csharp +public const int FileMaxSize = 104857600 + +``` + +### FileSign + + +文件头标记 + +Declaration +```csharp +public const uint FileSign = 5853007 + +``` + +### FileVersion + + +文件格式版本 + +Declaration +```csharp +public const string FileVersion = "2025.8.28" + +``` +--- + +# Class OfflinePlayModeParameters + + +离线运行模式的初始化参数 + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public class OfflinePlayModeParameters : InitializeParameters + +``` + +## Fields + + +### BuildinFileSystemParameters + +Declaration +```csharp +public FileSystemParameters BuildinFileSystemParameters + +``` +--- + +# Class PackageDetails + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public class PackageDetails + +``` + +## Fields + + +### FileVersion + + +文件版本 + +Declaration +```csharp +public string FileVersion + +``` + +### EnableAddressable + + +启用可寻址资源定位 + +Declaration +```csharp +public bool EnableAddressable + +``` + +### SupportExtensionless + + +支持无后缀名的资源定位地址 + +Declaration +```csharp +public bool SupportExtensionless + +``` + +### LocationToLower + + +资源定位地址大小写不敏感 + +Declaration +```csharp +public bool LocationToLower + +``` + +### IncludeAssetGUID + + +包含资源GUID数据 + +Declaration +```csharp +public bool IncludeAssetGUID + +``` + +### OutputNameStyle + + +文件名称样式 + +Declaration +```csharp +public int OutputNameStyle + +``` + +### BuildBundleType + + +构建资源包类型 + +Declaration +```csharp +public int BuildBundleType + +``` + +### BuildPipeline + + +构建管线名称 + +Declaration +```csharp +public string BuildPipeline + +``` + +### PackageName + + +资源包裹名称 + +Declaration +```csharp +public string PackageName + +``` + +### PackageVersion + + +资源包裹的版本信息 + +Declaration +```csharp +public string PackageVersion + +``` + +### PackageNote + + +资源包裹的备注信息 + +Declaration +```csharp +public string PackageNote + +``` + +### AssetTotalCount + + +主资源文件总数 + +Declaration +```csharp +public int AssetTotalCount + +``` + +### BundleTotalCount + + +资源包文件总数 + +Declaration +```csharp +public int BundleTotalCount + +``` +--- + +# Class PackageInvokeBuilder + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public static class PackageInvokeBuilder + +``` + +## Methods + + +### InvokeBuilder(PackageInvokeBuildParam) + +Declaration +```csharp +public static PackageInvokeBuildResult InvokeBuilder(PackageInvokeBuildParam buildParam) + +``` + +##### Returns + + +[YooAsset.PackageInvokeBuildResult](/docs/2.3.x/api/YooAsset/PackageInvokeBuildResult) + + +##### Parameters + +TypeName[YooAsset.PackageInvokeBuildParam](/docs/2.3.x/api/YooAsset/PackageInvokeBuildParam)*buildParam* +--- + +# Class PackageInvokeBuildParam + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public class PackageInvokeBuildParam + +``` + +## Fields + + +### PackageName + + +包裹名称 + +Declaration +```csharp +public readonly string PackageName + +``` + +### BuildPipelineName + + +构建管线名称 + +Declaration +```csharp +public string BuildPipelineName + +``` + +### BuildUserData + + +用户数据 + +Declaration +```csharp +public object BuildUserData + +``` + +### InvokeAssmeblyName + + +构建类所属程序集名称 + +Declaration +```csharp +public string InvokeAssmeblyName + +``` + +### InvokeClassFullName + + +构建执行的类名全称 +注意:类名必须包含命名空间! + +Declaration +```csharp +public string InvokeClassFullName + +``` + +### InvokeMethodName + + +构建执行的方法名称 +注意:执行方法必须满足 BindingFlags.Public | BindingFlags.Static + +Declaration +```csharp +public string InvokeMethodName + +``` +--- + +# Class PackageInvokeBuildResult + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public class PackageInvokeBuildResult + +``` + +## Fields + + +### PackageRootDirectory + +Declaration +```csharp +public string PackageRootDirectory + +``` +--- + +# Class PakcageInvokeBuilder + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public static class PakcageInvokeBuilder + +``` + +## Methods + + +### InvokeBuilder(PackageInvokeBuildParam) + +Declaration +```csharp +public static PackageInvokeBuildResult InvokeBuilder(PackageInvokeBuildParam buildParam) + +``` + +##### Returns + + +[YooAsset.PackageInvokeBuildResult](/docs/2.3.x/api/YooAsset/PackageInvokeBuildResult) + + +##### Parameters + +TypeName[YooAsset.PackageInvokeBuildParam](/docs/2.3.x/api/YooAsset/PackageInvokeBuildParam)*buildParam* +--- + +# Class PreDownloadContentOperation + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public sealed class PreDownloadContentOperation : AsyncOperationBase, IEnumerator, IComparable + +``` + +## Methods + + +### CreateResourceDownloader(int, int) + + +创建资源下载器,用于下载当前资源版本所有的资源包文件 + +Declaration +```csharp +public ResourceDownloaderOperation CreateResourceDownloader(int downloadingMaxNumber, int failedTryAgain) + +``` + +##### Returns + + +[YooAsset.ResourceDownloaderOperation](/docs/2.3.x/api/YooAsset/ResourceDownloaderOperation) + + +##### Parameters + +TypeNameDescription``System.Int32``*downloadingMaxNumber*同时下载的最大文件数``System.Int32``*failedTryAgain*下载失败的重试次数 + +### CreateResourceDownloader(string, int, int) + + +创建资源下载器,用于下载指定的资源标签关联的资源包文件 + +Declaration +```csharp +public ResourceDownloaderOperation CreateResourceDownloader(string tag, int downloadingMaxNumber, int failedTryAgain) + +``` + +##### Returns + + +[YooAsset.ResourceDownloaderOperation](/docs/2.3.x/api/YooAsset/ResourceDownloaderOperation) + + +##### Parameters + +TypeNameDescription``System.String``*tag*资源标签``System.Int32``*downloadingMaxNumber*同时下载的最大文件数``System.Int32``*failedTryAgain*下载失败的重试次数 + +### CreateResourceDownloader(string[], int, int) + + +创建资源下载器,用于下载指定的资源标签列表关联的资源包文件 + +Declaration +```csharp +public ResourceDownloaderOperation CreateResourceDownloader(string[] tags, int downloadingMaxNumber, int failedTryAgain) + +``` + +##### Returns + + +[YooAsset.ResourceDownloaderOperation](/docs/2.3.x/api/YooAsset/ResourceDownloaderOperation) + + +##### Parameters + +TypeNameDescription``System.String[]``*tags*资源标签列表``System.Int32``*downloadingMaxNumber*同时下载的最大文件数``System.Int32``*failedTryAgain*下载失败的重试次数 + +### CreateBundleDownloader(string, bool, int, int) + + +创建资源下载器,用于下载指定的资源依赖的资源包文件 + +Declaration +```csharp +public ResourceDownloaderOperation CreateBundleDownloader(string location, bool recursiveDownload, int downloadingMaxNumber, int failedTryAgain) + +``` + +##### Returns + + +[YooAsset.ResourceDownloaderOperation](/docs/2.3.x/api/YooAsset/ResourceDownloaderOperation) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源定位地址``System.Boolean``*recursiveDownload*``System.Int32``*downloadingMaxNumber*同时下载的最大文件数``System.Int32``*failedTryAgain*下载失败的重试次数 + +### CreateBundleDownloader(string[], bool, int, int) + + +创建资源下载器,用于下载指定的资源列表依赖的资源包文件 + +Declaration +```csharp +public ResourceDownloaderOperation CreateBundleDownloader(string[] locations, bool recursiveDownload, int downloadingMaxNumber, int failedTryAgain) + +``` + +##### Returns + + +[YooAsset.ResourceDownloaderOperation](/docs/2.3.x/api/YooAsset/ResourceDownloaderOperation) + + +##### Parameters + +TypeNameDescription``System.String[]``*locations*资源定位地址列表``System.Boolean``*recursiveDownload*``System.Int32``*downloadingMaxNumber*同时下载的最大文件数``System.Int32``*failedTryAgain*下载失败的重试次数 + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IComparable`` +--- + +# Class RawFileHandle + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public class RawFileHandle : HandleBase, IEnumerator, IDisposable + +``` + +## Methods + + +### WaitForAsyncComplete() + + +等待异步执行完毕 + +Declaration +```csharp +public void WaitForAsyncComplete() + +``` + +### GetRawFileData() + + +获取原生文件的二进制数据 + +Declaration +```csharp +public byte[] GetRawFileData() + +``` + +##### Returns + + +``System.Byte[]`` + + +### GetRawFileText() + + +获取原生文件的文本数据 + +Declaration +```csharp +public string GetRawFileText() + +``` + +##### Returns + + +``System.String`` + + +### GetRawFilePath() + + +获取原生文件的路径 + +Declaration +```csharp +public string GetRawFilePath() + +``` + +##### Returns + + +``System.String`` + + +## Events + + +### Completed + + +完成委托 + +Declaration +```csharp +public event Action Completed + +``` + +##### Event Type + + +``System.Action`` + + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IDisposable`` +--- + +# Class RequestPackageVersionOperation + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public abstract class RequestPackageVersionOperation : AsyncOperationBase, IEnumerator, IComparable + +``` + +## Properties + + +### PackageVersion + + +当前最新的包裹版本 + +Declaration +```csharp +public string PackageVersion { get; protected set; } + +``` + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IComparable`` +--- + +# Class ResourceDownloaderOperation + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public sealed class ResourceDownloaderOperation : DownloaderOperation, IEnumerator, IComparable + +``` + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IComparable`` +--- + +# Class ResourceImporterOperation + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public sealed class ResourceImporterOperation : DownloaderOperation, IEnumerator, IComparable + +``` + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IComparable`` +--- + +# Class ResourcePackage + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public class ResourcePackage + +``` + +## Properties + + +### InitializeStatus + + +初始化状态 + +Declaration +```csharp +public EOperationStatus InitializeStatus { get; } + +``` + +### PackageValid + + +包裹是否有效 + +Declaration +```csharp +public bool PackageValid { get; } + +``` + +## Fields + + +### PackageName + + +包裹名 + +Declaration +```csharp +public readonly string PackageName + +``` + +## Methods + + +### InitializeAsync(InitializeParameters) + + +异步初始化 + +Declaration +```csharp +public InitializationOperation InitializeAsync(InitializeParameters parameters) + +``` + +##### Returns + + +[YooAsset.InitializationOperation](/docs/2.3.x/api/YooAsset/InitializationOperation) + + +##### Parameters + +TypeName[YooAsset.InitializeParameters](/docs/2.3.x/api/YooAsset/InitializeParameters)*parameters* + +### DestroyAsync() + + +异步销毁 + +Declaration +```csharp +public DestroyOperation DestroyAsync() + +``` + +##### Returns + + +[YooAsset.DestroyOperation](/docs/2.3.x/api/YooAsset/DestroyOperation) + + +### RequestPackageVersionAsync(bool, int) + + +请求最新的资源版本 + +Declaration +```csharp +public RequestPackageVersionOperation RequestPackageVersionAsync(bool appendTimeTicks = true, int timeout = 60) + +``` + +##### Returns + + +[YooAsset.RequestPackageVersionOperation](/docs/2.3.x/api/YooAsset/RequestPackageVersionOperation) + + +##### Parameters + +TypeNameDescription``System.Boolean``*appendTimeTicks*在URL末尾添加时间戳``System.Int32``*timeout*超时时间(默认值:60秒) + +### UpdatePackageManifestAsync(string, int) + + +更新并加载指定版本的资源清单 + +Declaration +```csharp +public UpdatePackageManifestOperation UpdatePackageManifestAsync(string packageVersion, int timeout = 60) + +``` + +##### Returns + + +[YooAsset.UpdatePackageManifestOperation](/docs/2.3.x/api/YooAsset/UpdatePackageManifestOperation) + + +##### Parameters + +TypeNameDescription``System.String``*packageVersion*包裹版本``System.Int32``*timeout*超时时间(默认值:60秒) + +### PreDownloadContentAsync(string, int) + + +预下载指定版本的包裹资源 + +Declaration +```csharp +public PreDownloadContentOperation PreDownloadContentAsync(string packageVersion, int timeout = 60) + +``` + +##### Returns + + +[YooAsset.PreDownloadContentOperation](/docs/2.3.x/api/YooAsset/PreDownloadContentOperation) + + +##### Parameters + +TypeNameDescription``System.String``*packageVersion*包裹版本``System.Int32``*timeout*资源清单下载的超时时间(默认值:60秒) + +### ClearCacheFilesAsync(EFileClearMode, object) + + +清理缓存文件 + +Declaration +```csharp +public ClearCacheFilesOperation ClearCacheFilesAsync(EFileClearMode clearMode, object clearParam = null) + +``` + +##### Returns + + +[YooAsset.ClearCacheFilesOperation](/docs/2.3.x/api/YooAsset/ClearCacheFilesOperation) + + +##### Parameters + +TypeNameDescription[YooAsset.EFileClearMode](/docs/2.3.x/api/YooAsset/EFileClearMode)*clearMode*清理方式``System.Object``*clearParam*执行参数 + +### ClearCacheFilesAsync(string, object) + + +清理缓存文件 + +Declaration +```csharp +public ClearCacheFilesOperation ClearCacheFilesAsync(string clearMode, object clearParam = null) + +``` + +##### Returns + + +[YooAsset.ClearCacheFilesOperation](/docs/2.3.x/api/YooAsset/ClearCacheFilesOperation) + + +##### Parameters + +TypeNameDescription``System.String``*clearMode*清理方式``System.Object``*clearParam*执行参数 + +### GetPackageVersion() + + +获取当前加载包裹的版本信息 + +Declaration +```csharp +public string GetPackageVersion() + +``` + +##### Returns + + +``System.String`` + + +### GetPackageNote() + + +获取当前加载包裹的备注信息 + +Declaration +```csharp +public string GetPackageNote() + +``` + +##### Returns + + +``System.String`` + + +### GetPackageDetails() + + +获取当前加载包裹的详细信息 + +Declaration +```csharp +public PackageDetails GetPackageDetails() + +``` + +##### Returns + + +[YooAsset.PackageDetails](/docs/2.3.x/api/YooAsset/PackageDetails) + + +### UnloadAllAssetsAsync() + + +强制回收所有资源 + +Declaration +```csharp +public UnloadAllAssetsOperation UnloadAllAssetsAsync() + +``` + +##### Returns + + +[YooAsset.UnloadAllAssetsOperation](/docs/2.3.x/api/YooAsset/UnloadAllAssetsOperation) + + +### UnloadAllAssetsAsync(UnloadAllAssetsOptions) + + +强制回收所有资源 + +Declaration +```csharp +public UnloadAllAssetsOperation UnloadAllAssetsAsync(UnloadAllAssetsOptions options) + +``` + +##### Returns + + +[YooAsset.UnloadAllAssetsOperation](/docs/2.3.x/api/YooAsset/UnloadAllAssetsOperation) + + +##### Parameters + +TypeNameDescription[YooAsset.UnloadAllAssetsOptions](/docs/2.3.x/api/YooAsset/UnloadAllAssetsOptions)*options*卸载选项 + +### UnloadUnusedAssetsAsync(int) + + +回收不再使用的资源 +说明:卸载引用计数为零的资源 + +Declaration +```csharp +public UnloadUnusedAssetsOperation UnloadUnusedAssetsAsync(int loopCount = 10) + +``` + +##### Returns + + +[YooAsset.UnloadUnusedAssetsOperation](/docs/2.3.x/api/YooAsset/UnloadUnusedAssetsOperation) + + +##### Parameters + +TypeNameDescription``System.Int32``*loopCount*循环迭代次数 + +### TryUnloadUnusedAsset(string, int) + + +资源回收 +说明:尝试卸载指定的资源 + +Declaration +```csharp +public void TryUnloadUnusedAsset(string location, int loopCount = 10) + +``` + +##### Parameters + +TypeName``System.String``*location*``System.Int32``*loopCount* + +### TryUnloadUnusedAsset(AssetInfo, int) + + +资源回收 +说明:尝试卸载指定的资源 + +Declaration +```csharp +public void TryUnloadUnusedAsset(AssetInfo assetInfo, int loopCount = 10) + +``` + +##### Parameters + +TypeName[YooAsset.AssetInfo](/docs/2.3.x/api/YooAsset/AssetInfo)*assetInfo*``System.Int32``*loopCount* + +### IsNeedDownloadFromRemote(string) + + +是否需要从远端更新下载 + +Declaration +```csharp +public bool IsNeedDownloadFromRemote(string location) + +``` + +##### Returns + + +``System.Boolean`` + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址 + +### IsNeedDownloadFromRemote(AssetInfo) + + +是否需要从远端更新下载 + +Declaration +```csharp +public bool IsNeedDownloadFromRemote(AssetInfo assetInfo) + +``` + +##### Returns + + +``System.Boolean`` + + +##### Parameters + +TypeName[YooAsset.AssetInfo](/docs/2.3.x/api/YooAsset/AssetInfo)*assetInfo* + +### GetAllAssetInfos() + + +获取所有的资源信息 + +Declaration +```csharp +public AssetInfo[] GetAllAssetInfos() + +``` + +##### Returns + + +``YooAsset.AssetInfo[]`` + + +### GetAssetInfos(string) + + +获取资源信息列表 + +Declaration +```csharp +public AssetInfo[] GetAssetInfos(string tag) + +``` + +##### Returns + + +``YooAsset.AssetInfo[]`` + + +##### Parameters + +TypeNameDescription``System.String``*tag*资源标签 + +### GetAssetInfos(string[]) + + +获取资源信息列表 + +Declaration +```csharp +public AssetInfo[] GetAssetInfos(string[] tags) + +``` + +##### Returns + + +``YooAsset.AssetInfo[]`` + + +##### Parameters + +TypeNameDescription``System.String[]``*tags*资源标签列表 + +### GetAssetInfo(string) + + +获取资源信息 + +Declaration +```csharp +public AssetInfo GetAssetInfo(string location) + +``` + +##### Returns + + +[YooAsset.AssetInfo](/docs/2.3.x/api/YooAsset/AssetInfo) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址 + +### GetAssetInfo(string, Type) + + +获取资源信息 + +Declaration +```csharp +public AssetInfo GetAssetInfo(string location, Type type) + +``` + +##### Returns + + +[YooAsset.AssetInfo](/docs/2.3.x/api/YooAsset/AssetInfo) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.Type``*type*资源类型 + +### GetAssetInfoByGUID(string) + + +获取资源信息 + +Declaration +```csharp +public AssetInfo GetAssetInfoByGUID(string assetGUID) + +``` + +##### Returns + + +[YooAsset.AssetInfo](/docs/2.3.x/api/YooAsset/AssetInfo) + + +##### Parameters + +TypeNameDescription``System.String``*assetGUID*资源GUID + +### GetAssetInfoByGUID(string, Type) + + +获取资源信息 + +Declaration +```csharp +public AssetInfo GetAssetInfoByGUID(string assetGUID, Type type) + +``` + +##### Returns + + +[YooAsset.AssetInfo](/docs/2.3.x/api/YooAsset/AssetInfo) + + +##### Parameters + +TypeNameDescription``System.String``*assetGUID*资源GUID``System.Type``*type*资源类型 + +### CheckLocationValid(string) + + +检查资源定位地址是否有效 + +Declaration +```csharp +public bool CheckLocationValid(string location) + +``` + +##### Returns + + +``System.Boolean`` + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址 + +### LoadRawFileSync(AssetInfo) + + +同步加载原生文件 + +Declaration +```csharp +public RawFileHandle LoadRawFileSync(AssetInfo assetInfo) + +``` + +##### Returns + + +[YooAsset.RawFileHandle](/docs/2.3.x/api/YooAsset/RawFileHandle) + + +##### Parameters + +TypeNameDescription[YooAsset.AssetInfo](/docs/2.3.x/api/YooAsset/AssetInfo)*assetInfo*资源信息 + +### LoadRawFileSync(string) + + +同步加载原生文件 + +Declaration +```csharp +public RawFileHandle LoadRawFileSync(string location) + +``` + +##### Returns + + +[YooAsset.RawFileHandle](/docs/2.3.x/api/YooAsset/RawFileHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址 + +### LoadRawFileAsync(AssetInfo, uint) + + +异步加载原生文件 + +Declaration +```csharp +public RawFileHandle LoadRawFileAsync(AssetInfo assetInfo, uint priority = 0) + +``` + +##### Returns + + +[YooAsset.RawFileHandle](/docs/2.3.x/api/YooAsset/RawFileHandle) + + +##### Parameters + +TypeNameDescription[YooAsset.AssetInfo](/docs/2.3.x/api/YooAsset/AssetInfo)*assetInfo*资源信息``System.UInt32``*priority*加载的优先级 + +### LoadRawFileAsync(string, uint) + + +异步加载原生文件 + +Declaration +```csharp +public RawFileHandle LoadRawFileAsync(string location, uint priority = 0) + +``` + +##### Returns + + +[YooAsset.RawFileHandle](/docs/2.3.x/api/YooAsset/RawFileHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.UInt32``*priority*加载的优先级 + +### LoadSceneSync(string, LoadSceneMode, LocalPhysicsMode) + + +同步加载场景 + +Declaration +```csharp +public SceneHandle LoadSceneSync(string location, LoadSceneMode sceneMode = LoadSceneMode.Single, LocalPhysicsMode physicsMode = LocalPhysicsMode.None) + +``` + +##### Returns + + +[YooAsset.SceneHandle](/docs/2.3.x/api/YooAsset/SceneHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*场景的定位地址``UnityEngine.SceneManagement.LoadSceneMode``*sceneMode*场景加载模式``UnityEngine.SceneManagement.LocalPhysicsMode``*physicsMode*场景物理模式 + +### LoadSceneSync(AssetInfo, LoadSceneMode, LocalPhysicsMode) + + +同步加载场景 + +Declaration +```csharp +public SceneHandle LoadSceneSync(AssetInfo assetInfo, LoadSceneMode sceneMode = LoadSceneMode.Single, LocalPhysicsMode physicsMode = LocalPhysicsMode.None) + +``` + +##### Returns + + +[YooAsset.SceneHandle](/docs/2.3.x/api/YooAsset/SceneHandle) + + +##### Parameters + +TypeNameDescription[YooAsset.AssetInfo](/docs/2.3.x/api/YooAsset/AssetInfo)*assetInfo*场景的资源信息``UnityEngine.SceneManagement.LoadSceneMode``*sceneMode*场景加载模式``UnityEngine.SceneManagement.LocalPhysicsMode``*physicsMode*场景物理模式 + +### LoadSceneAsync(string, LoadSceneMode, LocalPhysicsMode, bool, uint) + + +异步加载场景 + +Declaration +```csharp +public SceneHandle LoadSceneAsync(string location, LoadSceneMode sceneMode = LoadSceneMode.Single, LocalPhysicsMode physicsMode = LocalPhysicsMode.None, bool suspendLoad = false, uint priority = 0) + +``` + +##### Returns + + +[YooAsset.SceneHandle](/docs/2.3.x/api/YooAsset/SceneHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*场景的定位地址``UnityEngine.SceneManagement.LoadSceneMode``*sceneMode*场景加载模式``UnityEngine.SceneManagement.LocalPhysicsMode``*physicsMode*场景物理模式``System.Boolean``*suspendLoad*场景加载到90%自动挂起``System.UInt32``*priority*加载的优先级 + +### LoadSceneAsync(AssetInfo, LoadSceneMode, LocalPhysicsMode, bool, uint) + + +异步加载场景 + +Declaration +```csharp +public SceneHandle LoadSceneAsync(AssetInfo assetInfo, LoadSceneMode sceneMode = LoadSceneMode.Single, LocalPhysicsMode physicsMode = LocalPhysicsMode.None, bool suspendLoad = false, uint priority = 0) + +``` + +##### Returns + + +[YooAsset.SceneHandle](/docs/2.3.x/api/YooAsset/SceneHandle) + + +##### Parameters + +TypeNameDescription[YooAsset.AssetInfo](/docs/2.3.x/api/YooAsset/AssetInfo)*assetInfo*场景的资源信息``UnityEngine.SceneManagement.LoadSceneMode``*sceneMode*场景加载模式``UnityEngine.SceneManagement.LocalPhysicsMode``*physicsMode*场景物理模式``System.Boolean``*suspendLoad*场景加载到90%自动挂起``System.UInt32``*priority*加载的优先级 + +### LoadAssetSync(AssetInfo) + + +同步加载资源对象 + +Declaration +```csharp +public AssetHandle LoadAssetSync(AssetInfo assetInfo) + +``` + +##### Returns + + +[YooAsset.AssetHandle](/docs/2.3.x/api/YooAsset/AssetHandle) + + +##### Parameters + +TypeNameDescription[YooAsset.AssetInfo](/docs/2.3.x/api/YooAsset/AssetInfo)*assetInfo*资源信息 + +### LoadAssetSync(string) + + +同步加载资源对象 + +Declaration +```csharp +public AssetHandle LoadAssetSync(string location) where TObject : Object + +``` + +##### Returns + + +[YooAsset.AssetHandle](/docs/2.3.x/api/YooAsset/AssetHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址 + +##### Type Parameters + +NameDescription``TObject``资源类型 + +### LoadAssetSync(string, Type) + + +同步加载资源对象 + +Declaration +```csharp +public AssetHandle LoadAssetSync(string location, Type type) + +``` + +##### Returns + + +[YooAsset.AssetHandle](/docs/2.3.x/api/YooAsset/AssetHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.Type``*type*资源类型 + +### LoadAssetSync(string) + + +同步加载资源对象 + +Declaration +```csharp +public AssetHandle LoadAssetSync(string location) + +``` + +##### Returns + + +[YooAsset.AssetHandle](/docs/2.3.x/api/YooAsset/AssetHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址 + +### LoadAssetAsync(AssetInfo, uint) + + +异步加载资源对象 + +Declaration +```csharp +public AssetHandle LoadAssetAsync(AssetInfo assetInfo, uint priority = 0) + +``` + +##### Returns + + +[YooAsset.AssetHandle](/docs/2.3.x/api/YooAsset/AssetHandle) + + +##### Parameters + +TypeNameDescription[YooAsset.AssetInfo](/docs/2.3.x/api/YooAsset/AssetInfo)*assetInfo*资源信息``System.UInt32``*priority*加载的优先级 + +### LoadAssetAsync(string, uint) + + +异步加载资源对象 + +Declaration +```csharp +public AssetHandle LoadAssetAsync(string location, uint priority = 0) where TObject : Object + +``` + +##### Returns + + +[YooAsset.AssetHandle](/docs/2.3.x/api/YooAsset/AssetHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.UInt32``*priority*加载的优先级 + +##### Type Parameters + +NameDescription``TObject``资源类型 + +### LoadAssetAsync(string, Type, uint) + + +异步加载资源对象 + +Declaration +```csharp +public AssetHandle LoadAssetAsync(string location, Type type, uint priority = 0) + +``` + +##### Returns + + +[YooAsset.AssetHandle](/docs/2.3.x/api/YooAsset/AssetHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.Type``*type*资源类型``System.UInt32``*priority*加载的优先级 + +### LoadAssetAsync(string, uint) + + +异步加载资源对象 + +Declaration +```csharp +public AssetHandle LoadAssetAsync(string location, uint priority = 0) + +``` + +##### Returns + + +[YooAsset.AssetHandle](/docs/2.3.x/api/YooAsset/AssetHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.UInt32``*priority*加载的优先级 + +### LoadSubAssetsSync(AssetInfo) + + +同步加载子资源对象 + +Declaration +```csharp +public SubAssetsHandle LoadSubAssetsSync(AssetInfo assetInfo) + +``` + +##### Returns + + +[YooAsset.SubAssetsHandle](/docs/2.3.x/api/YooAsset/SubAssetsHandle) + + +##### Parameters + +TypeNameDescription[YooAsset.AssetInfo](/docs/2.3.x/api/YooAsset/AssetInfo)*assetInfo*资源信息 + +### LoadSubAssetsSync(string) + + +同步加载子资源对象 + +Declaration +```csharp +public SubAssetsHandle LoadSubAssetsSync(string location) where TObject : Object + +``` + +##### Returns + + +[YooAsset.SubAssetsHandle](/docs/2.3.x/api/YooAsset/SubAssetsHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址 + +##### Type Parameters + +NameDescription``TObject``资源类型 + +### LoadSubAssetsSync(string, Type) + + +同步加载子资源对象 + +Declaration +```csharp +public SubAssetsHandle LoadSubAssetsSync(string location, Type type) + +``` + +##### Returns + + +[YooAsset.SubAssetsHandle](/docs/2.3.x/api/YooAsset/SubAssetsHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.Type``*type*子对象类型 + +### LoadSubAssetsSync(string) + + +同步加载子资源对象 + +Declaration +```csharp +public SubAssetsHandle LoadSubAssetsSync(string location) + +``` + +##### Returns + + +[YooAsset.SubAssetsHandle](/docs/2.3.x/api/YooAsset/SubAssetsHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址 + +### LoadSubAssetsAsync(AssetInfo, uint) + + +异步加载子资源对象 + +Declaration +```csharp +public SubAssetsHandle LoadSubAssetsAsync(AssetInfo assetInfo, uint priority = 0) + +``` + +##### Returns + + +[YooAsset.SubAssetsHandle](/docs/2.3.x/api/YooAsset/SubAssetsHandle) + + +##### Parameters + +TypeNameDescription[YooAsset.AssetInfo](/docs/2.3.x/api/YooAsset/AssetInfo)*assetInfo*资源信息``System.UInt32``*priority*加载的优先级 + +### LoadSubAssetsAsync(string, uint) + + +异步加载子资源对象 + +Declaration +```csharp +public SubAssetsHandle LoadSubAssetsAsync(string location, uint priority = 0) where TObject : Object + +``` + +##### Returns + + +[YooAsset.SubAssetsHandle](/docs/2.3.x/api/YooAsset/SubAssetsHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.UInt32``*priority*加载的优先级 + +##### Type Parameters + +NameDescription``TObject``资源类型 + +### LoadSubAssetsAsync(string, Type, uint) + + +异步加载子资源对象 + +Declaration +```csharp +public SubAssetsHandle LoadSubAssetsAsync(string location, Type type, uint priority = 0) + +``` + +##### Returns + + +[YooAsset.SubAssetsHandle](/docs/2.3.x/api/YooAsset/SubAssetsHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.Type``*type*子对象类型``System.UInt32``*priority*加载的优先级 + +### LoadSubAssetsAsync(string, uint) + + +异步加载子资源对象 + +Declaration +```csharp +public SubAssetsHandle LoadSubAssetsAsync(string location, uint priority = 0) + +``` + +##### Returns + + +[YooAsset.SubAssetsHandle](/docs/2.3.x/api/YooAsset/SubAssetsHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.UInt32``*priority*加载的优先级 + +### LoadAllAssetsSync(AssetInfo) + + +同步加载资源包内所有资源对象 + +Declaration +```csharp +public AllAssetsHandle LoadAllAssetsSync(AssetInfo assetInfo) + +``` + +##### Returns + + +[YooAsset.AllAssetsHandle](/docs/2.3.x/api/YooAsset/AllAssetsHandle) + + +##### Parameters + +TypeNameDescription[YooAsset.AssetInfo](/docs/2.3.x/api/YooAsset/AssetInfo)*assetInfo*资源信息 + +### LoadAllAssetsSync(string) + + +同步加载资源包内所有资源对象 + +Declaration +```csharp +public AllAssetsHandle LoadAllAssetsSync(string location) where TObject : Object + +``` + +##### Returns + + +[YooAsset.AllAssetsHandle](/docs/2.3.x/api/YooAsset/AllAssetsHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址 + +##### Type Parameters + +NameDescription``TObject``资源类型 + +### LoadAllAssetsSync(string, Type) + + +同步加载资源包内所有资源对象 + +Declaration +```csharp +public AllAssetsHandle LoadAllAssetsSync(string location, Type type) + +``` + +##### Returns + + +[YooAsset.AllAssetsHandle](/docs/2.3.x/api/YooAsset/AllAssetsHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.Type``*type*子对象类型 + +### LoadAllAssetsSync(string) + + +同步加载资源包内所有资源对象 + +Declaration +```csharp +public AllAssetsHandle LoadAllAssetsSync(string location) + +``` + +##### Returns + + +[YooAsset.AllAssetsHandle](/docs/2.3.x/api/YooAsset/AllAssetsHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址 + +### LoadAllAssetsAsync(AssetInfo, uint) + + +异步加载资源包内所有资源对象 + +Declaration +```csharp +public AllAssetsHandle LoadAllAssetsAsync(AssetInfo assetInfo, uint priority = 0) + +``` + +##### Returns + + +[YooAsset.AllAssetsHandle](/docs/2.3.x/api/YooAsset/AllAssetsHandle) + + +##### Parameters + +TypeNameDescription[YooAsset.AssetInfo](/docs/2.3.x/api/YooAsset/AssetInfo)*assetInfo*资源信息``System.UInt32``*priority*加载的优先级 + +### LoadAllAssetsAsync(string, uint) + + +异步加载资源包内所有资源对象 + +Declaration +```csharp +public AllAssetsHandle LoadAllAssetsAsync(string location, uint priority = 0) where TObject : Object + +``` + +##### Returns + + +[YooAsset.AllAssetsHandle](/docs/2.3.x/api/YooAsset/AllAssetsHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.UInt32``*priority*加载的优先级 + +##### Type Parameters + +NameDescription``TObject``资源类型 + +### LoadAllAssetsAsync(string, Type, uint) + + +异步加载资源包内所有资源对象 + +Declaration +```csharp +public AllAssetsHandle LoadAllAssetsAsync(string location, Type type, uint priority = 0) + +``` + +##### Returns + + +[YooAsset.AllAssetsHandle](/docs/2.3.x/api/YooAsset/AllAssetsHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.Type``*type*子对象类型``System.UInt32``*priority*加载的优先级 + +### LoadAllAssetsAsync(string, uint) + + +异步加载资源包内所有资源对象 + +Declaration +```csharp +public AllAssetsHandle LoadAllAssetsAsync(string location, uint priority = 0) + +``` + +##### Returns + + +[YooAsset.AllAssetsHandle](/docs/2.3.x/api/YooAsset/AllAssetsHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.UInt32``*priority*加载的优先级 + +### CreateResourceDownloader(int, int) + + +创建资源下载器,用于下载当前资源版本所有的资源包文件 + +Declaration +```csharp +public ResourceDownloaderOperation CreateResourceDownloader(int downloadingMaxNumber, int failedTryAgain) + +``` + +##### Returns + + +[YooAsset.ResourceDownloaderOperation](/docs/2.3.x/api/YooAsset/ResourceDownloaderOperation) + + +##### Parameters + +TypeNameDescription``System.Int32``*downloadingMaxNumber*同时下载的最大文件数``System.Int32``*failedTryAgain*下载失败的重试次数 + +### CreateResourceDownloader(string, int, int) + + +创建资源下载器,用于下载指定的资源标签关联的资源包文件 + +Declaration +```csharp +public ResourceDownloaderOperation CreateResourceDownloader(string tag, int downloadingMaxNumber, int failedTryAgain) + +``` + +##### Returns + + +[YooAsset.ResourceDownloaderOperation](/docs/2.3.x/api/YooAsset/ResourceDownloaderOperation) + + +##### Parameters + +TypeNameDescription``System.String``*tag*资源标签``System.Int32``*downloadingMaxNumber*同时下载的最大文件数``System.Int32``*failedTryAgain*下载失败的重试次数 + +### CreateResourceDownloader(string[], int, int) + + +创建资源下载器,用于下载指定的资源标签列表关联的资源包文件 + +Declaration +```csharp +public ResourceDownloaderOperation CreateResourceDownloader(string[] tags, int downloadingMaxNumber, int failedTryAgain) + +``` + +##### Returns + + +[YooAsset.ResourceDownloaderOperation](/docs/2.3.x/api/YooAsset/ResourceDownloaderOperation) + + +##### Parameters + +TypeNameDescription``System.String[]``*tags*资源标签列表``System.Int32``*downloadingMaxNumber*同时下载的最大文件数``System.Int32``*failedTryAgain*下载失败的重试次数 + +### CreateBundleDownloader(string, bool, int, int) + + +创建资源下载器,用于下载指定的资源依赖的资源包文件 + +Declaration +```csharp +public ResourceDownloaderOperation CreateBundleDownloader(string location, bool recursiveDownload, int downloadingMaxNumber, int failedTryAgain) + +``` + +##### Returns + + +[YooAsset.ResourceDownloaderOperation](/docs/2.3.x/api/YooAsset/ResourceDownloaderOperation) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.Boolean``*recursiveDownload*下载资源对象所属资源包内所有资源对象依赖的资源包``System.Int32``*downloadingMaxNumber*同时下载的最大文件数``System.Int32``*failedTryAgain*下载失败的重试次数 + +### CreateBundleDownloader(string, int, int) + +Declaration +```csharp +public ResourceDownloaderOperation CreateBundleDownloader(string location, int downloadingMaxNumber, int failedTryAgain) + +``` + +##### Returns + + +[YooAsset.ResourceDownloaderOperation](/docs/2.3.x/api/YooAsset/ResourceDownloaderOperation) + + +##### Parameters + +TypeName``System.String``*location*``System.Int32``*downloadingMaxNumber*``System.Int32``*failedTryAgain* + +### CreateBundleDownloader(string[], bool, int, int) + + +创建资源下载器,用于下载指定的资源列表依赖的资源包文件 + +Declaration +```csharp +public ResourceDownloaderOperation CreateBundleDownloader(string[] locations, bool recursiveDownload, int downloadingMaxNumber, int failedTryAgain) + +``` + +##### Returns + + +[YooAsset.ResourceDownloaderOperation](/docs/2.3.x/api/YooAsset/ResourceDownloaderOperation) + + +##### Parameters + +TypeNameDescription``System.String[]``*locations*资源的定位地址列表``System.Boolean``*recursiveDownload*下载资源对象所属资源包内所有资源对象依赖的资源包``System.Int32``*downloadingMaxNumber*同时下载的最大文件数``System.Int32``*failedTryAgain*下载失败的重试次数 + +### CreateBundleDownloader(string[], int, int) + +Declaration +```csharp +public ResourceDownloaderOperation CreateBundleDownloader(string[] locations, int downloadingMaxNumber, int failedTryAgain) + +``` + +##### Returns + + +[YooAsset.ResourceDownloaderOperation](/docs/2.3.x/api/YooAsset/ResourceDownloaderOperation) + + +##### Parameters + +TypeName``System.String[]``*locations*``System.Int32``*downloadingMaxNumber*``System.Int32``*failedTryAgain* + +### CreateBundleDownloader(AssetInfo, bool, int, int) + + +创建资源下载器,用于下载指定的资源依赖的资源包文件 + +Declaration +```csharp +public ResourceDownloaderOperation CreateBundleDownloader(AssetInfo assetInfo, bool recursiveDownload, int downloadingMaxNumber, int failedTryAgain) + +``` + +##### Returns + + +[YooAsset.ResourceDownloaderOperation](/docs/2.3.x/api/YooAsset/ResourceDownloaderOperation) + + +##### Parameters + +TypeNameDescription[YooAsset.AssetInfo](/docs/2.3.x/api/YooAsset/AssetInfo)*assetInfo*资源信息``System.Boolean``*recursiveDownload*下载资源对象所属资源包内所有资源对象依赖的资源包``System.Int32``*downloadingMaxNumber*同时下载的最大文件数``System.Int32``*failedTryAgain*下载失败的重试次数 + +### CreateBundleDownloader(AssetInfo, int, int) + +Declaration +```csharp +public ResourceDownloaderOperation CreateBundleDownloader(AssetInfo assetInfo, int downloadingMaxNumber, int failedTryAgain) + +``` + +##### Returns + + +[YooAsset.ResourceDownloaderOperation](/docs/2.3.x/api/YooAsset/ResourceDownloaderOperation) + + +##### Parameters + +TypeName[YooAsset.AssetInfo](/docs/2.3.x/api/YooAsset/AssetInfo)*assetInfo*``System.Int32``*downloadingMaxNumber*``System.Int32``*failedTryAgain* + +### CreateBundleDownloader(AssetInfo[], bool, int, int) + + +创建资源下载器,用于下载指定的资源列表依赖的资源包文件 + +Declaration +```csharp +public ResourceDownloaderOperation CreateBundleDownloader(AssetInfo[] assetInfos, bool recursiveDownload, int downloadingMaxNumber, int failedTryAgain) + +``` + +##### Returns + + +[YooAsset.ResourceDownloaderOperation](/docs/2.3.x/api/YooAsset/ResourceDownloaderOperation) + + +##### Parameters + +TypeNameDescription``YooAsset.AssetInfo[]``*assetInfos*资源信息列表``System.Boolean``*recursiveDownload*下载资源对象所属资源包内所有资源对象依赖的资源包``System.Int32``*downloadingMaxNumber*同时下载的最大文件数``System.Int32``*failedTryAgain*下载失败的重试次数 + +### CreateBundleDownloader(AssetInfo[], int, int) + +Declaration +```csharp +public ResourceDownloaderOperation CreateBundleDownloader(AssetInfo[] assetInfos, int downloadingMaxNumber, int failedTryAgain) + +``` + +##### Returns + + +[YooAsset.ResourceDownloaderOperation](/docs/2.3.x/api/YooAsset/ResourceDownloaderOperation) + + +##### Parameters + +TypeName``YooAsset.AssetInfo[]``*assetInfos*``System.Int32``*downloadingMaxNumber*``System.Int32``*failedTryAgain* + +### CreateResourceUnpacker(int, int) + + +创建内置资源解压器,用于解压当前资源版本所有的资源包文件 + +Declaration +```csharp +public ResourceUnpackerOperation CreateResourceUnpacker(int unpackingMaxNumber, int failedTryAgain) + +``` + +##### Returns + + +[YooAsset.ResourceUnpackerOperation](/docs/2.3.x/api/YooAsset/ResourceUnpackerOperation) + + +##### Parameters + +TypeNameDescription``System.Int32``*unpackingMaxNumber*同时解压的最大文件数``System.Int32``*failedTryAgain*解压失败的重试次数 + +### CreateResourceUnpacker(string, int, int) + + +创建内置资源解压器,用于解压指定的资源标签关联的资源包文件 + +Declaration +```csharp +public ResourceUnpackerOperation CreateResourceUnpacker(string tag, int unpackingMaxNumber, int failedTryAgain) + +``` + +##### Returns + + +[YooAsset.ResourceUnpackerOperation](/docs/2.3.x/api/YooAsset/ResourceUnpackerOperation) + + +##### Parameters + +TypeNameDescription``System.String``*tag*资源标签``System.Int32``*unpackingMaxNumber*同时解压的最大文件数``System.Int32``*failedTryAgain*解压失败的重试次数 + +### CreateResourceUnpacker(string[], int, int) + + +创建内置资源解压器,用于解压指定的资源标签列表关联的资源包文件 + +Declaration +```csharp +public ResourceUnpackerOperation CreateResourceUnpacker(string[] tags, int unpackingMaxNumber, int failedTryAgain) + +``` + +##### Returns + + +[YooAsset.ResourceUnpackerOperation](/docs/2.3.x/api/YooAsset/ResourceUnpackerOperation) + + +##### Parameters + +TypeNameDescription``System.String[]``*tags*资源标签列表``System.Int32``*unpackingMaxNumber*同时解压的最大文件数``System.Int32``*failedTryAgain*解压失败的重试次数 + +### CreateResourceImporter(string[], int, int) + + +创建资源导入器 +注意:资源文件名称必须和资源服务器部署的文件名称一致! + +Declaration +```csharp +public ResourceImporterOperation CreateResourceImporter(string[] filePaths, int importerMaxNumber, int failedTryAgain) + +``` + +##### Returns + + +[YooAsset.ResourceImporterOperation](/docs/2.3.x/api/YooAsset/ResourceImporterOperation) + + +##### Parameters + +TypeNameDescription``System.String[]``*filePaths*资源路径列表``System.Int32``*importerMaxNumber*同时导入的最大文件数``System.Int32``*failedTryAgain*导入失败的重试次数 + +### CreateResourceImporter(ImportFileInfo[], int, int) + + +创建资源导入器 +注意:资源信息里需要指定BundleName或BundleGUID! + +Declaration +```csharp +public ResourceImporterOperation CreateResourceImporter(ImportFileInfo[] fileInfos, int importerMaxNumber, int failedTryAgain) + +``` + +##### Returns + + +[YooAsset.ResourceImporterOperation](/docs/2.3.x/api/YooAsset/ResourceImporterOperation) + + +##### Parameters + +TypeNameDescription``YooAsset.ImportFileInfo[]``*fileInfos*资源信息列表``System.Int32``*importerMaxNumber*同时导入的最大文件数``System.Int32``*failedTryAgain*导入失败的重试次数 +--- + +# Class ResourceUnpackerOperation + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public sealed class ResourceUnpackerOperation : DownloaderOperation, IEnumerator, IComparable + +``` + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IComparable`` +--- + +# Class SceneHandle + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public class SceneHandle : HandleBase, IEnumerator, IDisposable + +``` + +## Properties + + +### SceneName + + +场景名称 + +Declaration +```csharp +public string SceneName { get; } + +``` + +### SceneObject + + +场景对象 + +Declaration +```csharp +public Scene SceneObject { get; } + +``` + +## Methods + + +### ActivateScene() + + +激活场景(当同时存在多个场景时用于切换激活场景) + +Declaration +```csharp +public bool ActivateScene() + +``` + +##### Returns + + +``System.Boolean`` + + +### UnSuspend() + + +解除场景加载挂起操作 + +Declaration +```csharp +public bool UnSuspend() + +``` + +##### Returns + + +``System.Boolean`` + + +### UnloadAsync() + + +异步卸载场景对象 +注意:场景卸载成功后,会自动释放该handle的引用计数! + +Declaration +```csharp +public UnloadSceneOperation UnloadAsync() + +``` + +##### Returns + + +[YooAsset.UnloadSceneOperation](/docs/2.3.x/api/YooAsset/UnloadSceneOperation) + + +## Events + + +### Completed + + +完成委托 + +Declaration +```csharp +public event Action Completed + +``` + +##### Event Type + + +``System.Action`` + + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IDisposable`` +--- + +# Class SubAssetsHandle + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public sealed class SubAssetsHandle : HandleBase, IEnumerator, IDisposable + +``` + +## Properties + + +### SubAssetObjects + + +子资源对象集合 + +Declaration +```csharp +public IReadOnlyList SubAssetObjects { get; } + +``` + +## Methods + + +### WaitForAsyncComplete() + + +等待异步执行完毕 + +Declaration +```csharp +public void WaitForAsyncComplete() + +``` + +### GetSubAssetObject(string) + + +获取子资源对象 + +Declaration +```csharp +public TObject GetSubAssetObject(string assetName) where TObject : Object + +``` + +##### Returns + + +```` + + +##### Parameters + +TypeNameDescription``System.String``*assetName*子资源对象名称 + +##### Type Parameters + +NameDescription``TObject``子资源对象类型 + +### GetSubAssetObjects() + + +获取所有的子资源对象集合 + +Declaration +```csharp +public TObject[] GetSubAssetObjects() where TObject : Object + +``` + +##### Returns + + +``[]`` + + +##### Type Parameters + +NameDescription``TObject``子资源对象类型 + +## Events + + +### Completed + + +完成委托 + +Declaration +```csharp +public event Action Completed + +``` + +##### Event Type + + +``System.Action`` + + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IDisposable`` +--- + +# Delegate UnityWebRequestDelegate + + +自定义下载器的请求委托 + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public delegate UnityWebRequest UnityWebRequestDelegate(string url) + +``` +--- + +# Class UnloadAllAssetsOperation + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public sealed class UnloadAllAssetsOperation : AsyncOperationBase, IEnumerator, IComparable + +``` + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IComparable`` +--- + +# Class UnloadAllAssetsOptions + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public sealed class UnloadAllAssetsOptions + +``` + +## Fields + + +### ReleaseAllHandles + + +释放所有资源句柄,防止卸载过程中触发完成回调! + +Declaration +```csharp +public bool ReleaseAllHandles + +``` + +### LockLoadOperation + + +卸载过程中锁定加载操作,防止新的任务请求! + +Declaration +```csharp +public bool LockLoadOperation + +``` +--- + +# Class UnloadSceneOperation + + +场景卸载异步操作类 + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public sealed class UnloadSceneOperation : AsyncOperationBase, IEnumerator, IComparable + +``` + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IComparable`` +--- + +# Class UnloadUnusedAssetsOperation + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public sealed class UnloadUnusedAssetsOperation : AsyncOperationBase, IEnumerator, IComparable + +``` + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IComparable`` +--- + +# Class UpdatePackageManifestOperation + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public sealed class UpdatePackageManifestOperation : AsyncOperationBase, IEnumerator, IComparable + +``` + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IComparable`` +--- + +# Struct WebDecryptFileInfo + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public struct WebDecryptFileInfo + +``` + +## Fields + + +### BundleName + + +资源包名称 + +Declaration +```csharp +public string BundleName + +``` + +### FileLoadCRC + + +Unity引擎用于内容校验的CRC + +Declaration +```csharp +public uint FileLoadCRC + +``` + +### FileData + + +文件字节数据 + +Declaration +```csharp +public byte[] FileData + +``` +--- + +# Struct WebDecryptResult + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public struct WebDecryptResult + +``` + +## Fields + + +### Result + + +资源包对象 + +Declaration +```csharp +public AssetBundle Result + +``` +--- + +# Class WebPlayModeParameters + + +WebGL运行模式的初始化参数 + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public class WebPlayModeParameters : InitializeParameters + +``` + +## Fields + + +### WebServerFileSystemParameters + +Declaration +```csharp +public FileSystemParameters WebServerFileSystemParameters + +``` + +### WebRemoteFileSystemParameters + +Declaration +```csharp +public FileSystemParameters WebRemoteFileSystemParameters + +``` +--- + +# Class YooAssets + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public static class YooAssets + +``` + +## Properties + + +### Initialized + + +是否已经初始化 + +Declaration +```csharp +public static bool Initialized { get; } + +``` + +## Methods + + +### Initialize(ILogger) + + +初始化资源系统 + +Declaration +```csharp +public static void Initialize(ILogger logger = null) + +``` + +##### Parameters + +TypeNameDescription[YooAsset.ILogger](/docs/2.3.x/api/YooAsset/ILogger)*logger*自定义日志处理 + +### Destroy() + + +销毁资源系统 + +Declaration +```csharp +public static void Destroy() + +``` + +### CreatePackage(string) + + +创建资源包裹 + +Declaration +```csharp +public static ResourcePackage CreatePackage(string packageName) + +``` + +##### Returns + + +[YooAsset.ResourcePackage](/docs/2.3.x/api/YooAsset/ResourcePackage) + + +##### Parameters + +TypeNameDescription``System.String``*packageName*包裹名称 + +### GetPackage(string) + + +获取资源包裹 + +Declaration +```csharp +public static ResourcePackage GetPackage(string packageName) + +``` + +##### Returns + + +[YooAsset.ResourcePackage](/docs/2.3.x/api/YooAsset/ResourcePackage) + + +##### Parameters + +TypeNameDescription``System.String``*packageName*包裹名称 + +### TryGetPackage(string) + + +尝试获取资源包裹 + +Declaration +```csharp +public static ResourcePackage TryGetPackage(string packageName) + +``` + +##### Returns + + +[YooAsset.ResourcePackage](/docs/2.3.x/api/YooAsset/ResourcePackage) + + +##### Parameters + +TypeNameDescription``System.String``*packageName*包裹名称 + +### GetAllPackages() + + +获取所有资源包裹 + +Declaration +```csharp +public static List GetAllPackages() + +``` + +##### Returns + + +``System.Collections.Generic.List`` + + +### RemovePackage(string) + + +移除资源包裹 + +Declaration +```csharp +public static bool RemovePackage(string packageName) + +``` + +##### Returns + + +``System.Boolean`` + + +##### Parameters + +TypeNameDescription``System.String``*packageName*包裹名称 + +### RemovePackage(ResourcePackage) + + +移除资源包裹 + +Declaration +```csharp +public static bool RemovePackage(ResourcePackage package) + +``` + +##### Returns + + +``System.Boolean`` + + +##### Parameters + +TypeNameDescription[YooAsset.ResourcePackage](/docs/2.3.x/api/YooAsset/ResourcePackage)*package*包裹实例对象 + +### ContainsPackage(string) + + +检测资源包裹是否存在 + +Declaration +```csharp +public static bool ContainsPackage(string packageName) + +``` + +##### Returns + + +``System.Boolean`` + + +##### Parameters + +TypeNameDescription``System.String``*packageName*包裹名称 + +### StartOperation(GameAsyncOperation) + + +开启一个异步操作 + +Declaration +```csharp +public static void StartOperation(GameAsyncOperation operation) + +``` + +##### Parameters + +TypeNameDescription[YooAsset.GameAsyncOperation](/docs/2.3.x/api/YooAsset/GameAsyncOperation)*operation*异步操作对象 + +### SetDownloadSystemUnityWebRequest(UnityWebRequestDelegate) + + +设置下载系统参数,自定义下载请求 + +Declaration +```csharp +public static void SetDownloadSystemUnityWebRequest(UnityWebRequestDelegate createDelegate) + +``` + +##### Parameters + +TypeName[YooAsset.UnityWebRequestDelegate](/docs/2.3.x/api/YooAsset/UnityWebRequestDelegate)*createDelegate* + +### SetOperationSystemMaxTimeSlice(long) + + +设置异步系统参数,每帧执行消耗的最大时间切片(单位:毫秒) + +Declaration +```csharp +public static void SetOperationSystemMaxTimeSlice(long milliseconds) + +``` + +##### Parameters + +TypeName``System.Int64``*milliseconds* + +### SetDefaultPackage(ResourcePackage) + + +设置默认的资源包 + +Declaration +```csharp +public static void SetDefaultPackage(ResourcePackage package) + +``` + +##### Parameters + +TypeName[YooAsset.ResourcePackage](/docs/2.3.x/api/YooAsset/ResourcePackage)*package* + +### IsNeedDownloadFromRemote(string) + + +是否需要从远端更新下载 + +Declaration +```csharp +public static bool IsNeedDownloadFromRemote(string location) + +``` + +##### Returns + + +``System.Boolean`` + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址 + +### IsNeedDownloadFromRemote(AssetInfo) + + +是否需要从远端更新下载 + +Declaration +```csharp +public static bool IsNeedDownloadFromRemote(AssetInfo assetInfo) + +``` + +##### Returns + + +``System.Boolean`` + + +##### Parameters + +TypeName[YooAsset.AssetInfo](/docs/2.3.x/api/YooAsset/AssetInfo)*assetInfo* + +### GetAssetInfos(string) + + +获取资源信息列表 + +Declaration +```csharp +public static AssetInfo[] GetAssetInfos(string tag) + +``` + +##### Returns + + +``YooAsset.AssetInfo[]`` + + +##### Parameters + +TypeNameDescription``System.String``*tag*资源标签 + +### GetAssetInfos(string[]) + + +获取资源信息列表 + +Declaration +```csharp +public static AssetInfo[] GetAssetInfos(string[] tags) + +``` + +##### Returns + + +``YooAsset.AssetInfo[]`` + + +##### Parameters + +TypeNameDescription``System.String[]``*tags*资源标签列表 + +### GetAssetInfo(string) + + +获取资源信息 + +Declaration +```csharp +public static AssetInfo GetAssetInfo(string location) + +``` + +##### Returns + + +[YooAsset.AssetInfo](/docs/2.3.x/api/YooAsset/AssetInfo) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址 + +### GetAssetInfo(string, Type) + + +获取资源信息 + +Declaration +```csharp +public static AssetInfo GetAssetInfo(string location, Type type) + +``` + +##### Returns + + +[YooAsset.AssetInfo](/docs/2.3.x/api/YooAsset/AssetInfo) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.Type``*type*资源类型 + +### GetAssetInfoByGUID(string) + + +获取资源信息 + +Declaration +```csharp +public static AssetInfo GetAssetInfoByGUID(string assetGUID) + +``` + +##### Returns + + +[YooAsset.AssetInfo](/docs/2.3.x/api/YooAsset/AssetInfo) + + +##### Parameters + +TypeNameDescription``System.String``*assetGUID*资源GUID + +### GetAssetInfoByGUID(string, Type) + + +获取资源信息 + +Declaration +```csharp +public static AssetInfo GetAssetInfoByGUID(string assetGUID, Type type) + +``` + +##### Returns + + +[YooAsset.AssetInfo](/docs/2.3.x/api/YooAsset/AssetInfo) + + +##### Parameters + +TypeNameDescription``System.String``*assetGUID*资源GUID``System.Type``*type*资源类型 + +### CheckLocationValid(string) + + +检查资源定位地址是否有效 + +Declaration +```csharp +public static bool CheckLocationValid(string location) + +``` + +##### Returns + + +``System.Boolean`` + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址 + +### LoadRawFileSync(AssetInfo) + + +同步加载原生文件 + +Declaration +```csharp +public static RawFileHandle LoadRawFileSync(AssetInfo assetInfo) + +``` + +##### Returns + + +[YooAsset.RawFileHandle](/docs/2.3.x/api/YooAsset/RawFileHandle) + + +##### Parameters + +TypeNameDescription[YooAsset.AssetInfo](/docs/2.3.x/api/YooAsset/AssetInfo)*assetInfo*资源信息 + +### LoadRawFileSync(string) + + +同步加载原生文件 + +Declaration +```csharp +public static RawFileHandle LoadRawFileSync(string location) + +``` + +##### Returns + + +[YooAsset.RawFileHandle](/docs/2.3.x/api/YooAsset/RawFileHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址 + +### LoadRawFileAsync(AssetInfo, uint) + + +异步加载原生文件 + +Declaration +```csharp +public static RawFileHandle LoadRawFileAsync(AssetInfo assetInfo, uint priority = 0) + +``` + +##### Returns + + +[YooAsset.RawFileHandle](/docs/2.3.x/api/YooAsset/RawFileHandle) + + +##### Parameters + +TypeNameDescription[YooAsset.AssetInfo](/docs/2.3.x/api/YooAsset/AssetInfo)*assetInfo*资源信息``System.UInt32``*priority* + +### LoadRawFileAsync(string, uint) + + +异步加载原生文件 + +Declaration +```csharp +public static RawFileHandle LoadRawFileAsync(string location, uint priority = 0) + +``` + +##### Returns + + +[YooAsset.RawFileHandle](/docs/2.3.x/api/YooAsset/RawFileHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.UInt32``*priority* + +### LoadSceneSync(string, LoadSceneMode, LocalPhysicsMode) + + +同步加载场景 + +Declaration +```csharp +public static SceneHandle LoadSceneSync(string location, LoadSceneMode sceneMode = LoadSceneMode.Single, LocalPhysicsMode physicsMode = LocalPhysicsMode.None) + +``` + +##### Returns + + +[YooAsset.SceneHandle](/docs/2.3.x/api/YooAsset/SceneHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*场景的定位地址``UnityEngine.SceneManagement.LoadSceneMode``*sceneMode*场景加载模式``UnityEngine.SceneManagement.LocalPhysicsMode``*physicsMode*场景物理模式 + +### LoadSceneSync(AssetInfo, LoadSceneMode, LocalPhysicsMode) + + +同步加载场景 + +Declaration +```csharp +public static SceneHandle LoadSceneSync(AssetInfo assetInfo, LoadSceneMode sceneMode = LoadSceneMode.Single, LocalPhysicsMode physicsMode = LocalPhysicsMode.None) + +``` + +##### Returns + + +[YooAsset.SceneHandle](/docs/2.3.x/api/YooAsset/SceneHandle) + + +##### Parameters + +TypeNameDescription[YooAsset.AssetInfo](/docs/2.3.x/api/YooAsset/AssetInfo)*assetInfo*场景的资源信息``UnityEngine.SceneManagement.LoadSceneMode``*sceneMode*场景加载模式``UnityEngine.SceneManagement.LocalPhysicsMode``*physicsMode*场景物理模式 + +### LoadSceneAsync(string, LoadSceneMode, LocalPhysicsMode, bool, uint) + + +异步加载场景 + +Declaration +```csharp +public static SceneHandle LoadSceneAsync(string location, LoadSceneMode sceneMode = LoadSceneMode.Single, LocalPhysicsMode physicsMode = LocalPhysicsMode.None, bool suspendLoad = false, uint priority = 100) + +``` + +##### Returns + + +[YooAsset.SceneHandle](/docs/2.3.x/api/YooAsset/SceneHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*场景的定位地址``UnityEngine.SceneManagement.LoadSceneMode``*sceneMode*场景加载模式``UnityEngine.SceneManagement.LocalPhysicsMode``*physicsMode*场景物理模式``System.Boolean``*suspendLoad*场景加载到90%自动挂起``System.UInt32``*priority*优先级 + +### LoadSceneAsync(AssetInfo, LoadSceneMode, LocalPhysicsMode, bool, uint) + + +异步加载场景 + +Declaration +```csharp +public static SceneHandle LoadSceneAsync(AssetInfo assetInfo, LoadSceneMode sceneMode = LoadSceneMode.Single, LocalPhysicsMode physicsMode = LocalPhysicsMode.None, bool suspendLoad = false, uint priority = 100) + +``` + +##### Returns + + +[YooAsset.SceneHandle](/docs/2.3.x/api/YooAsset/SceneHandle) + + +##### Parameters + +TypeNameDescription[YooAsset.AssetInfo](/docs/2.3.x/api/YooAsset/AssetInfo)*assetInfo*场景的资源信息``UnityEngine.SceneManagement.LoadSceneMode``*sceneMode*场景加载模式``UnityEngine.SceneManagement.LocalPhysicsMode``*physicsMode*场景物理模式``System.Boolean``*suspendLoad*场景加载到90%自动挂起``System.UInt32``*priority*优先级 + +### LoadAssetSync(AssetInfo) + + +同步加载资源对象 + +Declaration +```csharp +public static AssetHandle LoadAssetSync(AssetInfo assetInfo) + +``` + +##### Returns + + +[YooAsset.AssetHandle](/docs/2.3.x/api/YooAsset/AssetHandle) + + +##### Parameters + +TypeNameDescription[YooAsset.AssetInfo](/docs/2.3.x/api/YooAsset/AssetInfo)*assetInfo*资源信息 + +### LoadAssetSync(string) + + +同步加载资源对象 + +Declaration +```csharp +public static AssetHandle LoadAssetSync(string location) where TObject : Object + +``` + +##### Returns + + +[YooAsset.AssetHandle](/docs/2.3.x/api/YooAsset/AssetHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址 + +##### Type Parameters + +NameDescription``TObject``资源类型 + +### LoadAssetSync(string, Type) + + +同步加载资源对象 + +Declaration +```csharp +public static AssetHandle LoadAssetSync(string location, Type type) + +``` + +##### Returns + + +[YooAsset.AssetHandle](/docs/2.3.x/api/YooAsset/AssetHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.Type``*type*资源类型 + +### LoadAssetSync(string) + + +同步加载资源对象 + +Declaration +```csharp +public static AssetHandle LoadAssetSync(string location) + +``` + +##### Returns + + +[YooAsset.AssetHandle](/docs/2.3.x/api/YooAsset/AssetHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址 + +### LoadAssetAsync(AssetInfo, uint) + + +异步加载资源对象 + +Declaration +```csharp +public static AssetHandle LoadAssetAsync(AssetInfo assetInfo, uint priority = 0) + +``` + +##### Returns + + +[YooAsset.AssetHandle](/docs/2.3.x/api/YooAsset/AssetHandle) + + +##### Parameters + +TypeNameDescription[YooAsset.AssetInfo](/docs/2.3.x/api/YooAsset/AssetInfo)*assetInfo*资源信息``System.UInt32``*priority* + +### LoadAssetAsync(string, uint) + + +异步加载资源对象 + +Declaration +```csharp +public static AssetHandle LoadAssetAsync(string location, uint priority = 0) where TObject : Object + +``` + +##### Returns + + +[YooAsset.AssetHandle](/docs/2.3.x/api/YooAsset/AssetHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.UInt32``*priority* + +##### Type Parameters + +NameDescription``TObject``资源类型 + +### LoadAssetAsync(string, Type, uint) + + +异步加载资源对象 + +Declaration +```csharp +public static AssetHandle LoadAssetAsync(string location, Type type, uint priority = 0) + +``` + +##### Returns + + +[YooAsset.AssetHandle](/docs/2.3.x/api/YooAsset/AssetHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.Type``*type*资源类型``System.UInt32``*priority* + +### LoadAssetAsync(string, uint) + + +异步加载资源对象 + +Declaration +```csharp +public static AssetHandle LoadAssetAsync(string location, uint priority = 0) + +``` + +##### Returns + + +[YooAsset.AssetHandle](/docs/2.3.x/api/YooAsset/AssetHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.UInt32``*priority* + +### LoadSubAssetsSync(AssetInfo) + + +同步加载子资源对象 + +Declaration +```csharp +public static SubAssetsHandle LoadSubAssetsSync(AssetInfo assetInfo) + +``` + +##### Returns + + +[YooAsset.SubAssetsHandle](/docs/2.3.x/api/YooAsset/SubAssetsHandle) + + +##### Parameters + +TypeNameDescription[YooAsset.AssetInfo](/docs/2.3.x/api/YooAsset/AssetInfo)*assetInfo*资源信息 + +### LoadSubAssetsSync(string) + + +同步加载子资源对象 + +Declaration +```csharp +public static SubAssetsHandle LoadSubAssetsSync(string location) where TObject : Object + +``` + +##### Returns + + +[YooAsset.SubAssetsHandle](/docs/2.3.x/api/YooAsset/SubAssetsHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址 + +##### Type Parameters + +NameDescription``TObject``资源类型 + +### LoadSubAssetsSync(string, Type) + + +同步加载子资源对象 + +Declaration +```csharp +public static SubAssetsHandle LoadSubAssetsSync(string location, Type type) + +``` + +##### Returns + + +[YooAsset.SubAssetsHandle](/docs/2.3.x/api/YooAsset/SubAssetsHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.Type``*type*子对象类型 + +### LoadSubAssetsSync(string) + + +同步加载子资源对象 + +Declaration +```csharp +public static SubAssetsHandle LoadSubAssetsSync(string location) + +``` + +##### Returns + + +[YooAsset.SubAssetsHandle](/docs/2.3.x/api/YooAsset/SubAssetsHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址 + +### LoadSubAssetsAsync(AssetInfo, uint) + + +异步加载子资源对象 + +Declaration +```csharp +public static SubAssetsHandle LoadSubAssetsAsync(AssetInfo assetInfo, uint priority = 0) + +``` + +##### Returns + + +[YooAsset.SubAssetsHandle](/docs/2.3.x/api/YooAsset/SubAssetsHandle) + + +##### Parameters + +TypeNameDescription[YooAsset.AssetInfo](/docs/2.3.x/api/YooAsset/AssetInfo)*assetInfo*资源信息``System.UInt32``*priority* + +### LoadSubAssetsAsync(string, uint) + + +异步加载子资源对象 + +Declaration +```csharp +public static SubAssetsHandle LoadSubAssetsAsync(string location, uint priority = 0) where TObject : Object + +``` + +##### Returns + + +[YooAsset.SubAssetsHandle](/docs/2.3.x/api/YooAsset/SubAssetsHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.UInt32``*priority* + +##### Type Parameters + +NameDescription``TObject``资源类型 + +### LoadSubAssetsAsync(string, Type, uint) + + +异步加载子资源对象 + +Declaration +```csharp +public static SubAssetsHandle LoadSubAssetsAsync(string location, Type type, uint priority = 0) + +``` + +##### Returns + + +[YooAsset.SubAssetsHandle](/docs/2.3.x/api/YooAsset/SubAssetsHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.Type``*type*子对象类型``System.UInt32``*priority* + +### LoadSubAssetsAsync(string, uint) + + +异步加载子资源对象 + +Declaration +```csharp +public static SubAssetsHandle LoadSubAssetsAsync(string location, uint priority = 0) + +``` + +##### Returns + + +[YooAsset.SubAssetsHandle](/docs/2.3.x/api/YooAsset/SubAssetsHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.UInt32``*priority* + +### LoadAllAssetsSync(AssetInfo) + + +同步加载资源包内所有资源对象 + +Declaration +```csharp +public static AllAssetsHandle LoadAllAssetsSync(AssetInfo assetInfo) + +``` + +##### Returns + + +[YooAsset.AllAssetsHandle](/docs/2.3.x/api/YooAsset/AllAssetsHandle) + + +##### Parameters + +TypeNameDescription[YooAsset.AssetInfo](/docs/2.3.x/api/YooAsset/AssetInfo)*assetInfo*资源信息 + +### LoadAllAssetsSync(string) + + +同步加载资源包内所有资源对象 + +Declaration +```csharp +public static AllAssetsHandle LoadAllAssetsSync(string location) where TObject : Object + +``` + +##### Returns + + +[YooAsset.AllAssetsHandle](/docs/2.3.x/api/YooAsset/AllAssetsHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址 + +##### Type Parameters + +NameDescription``TObject``资源类型 + +### LoadAllAssetsSync(string, Type) + + +同步加载资源包内所有资源对象 + +Declaration +```csharp +public static AllAssetsHandle LoadAllAssetsSync(string location, Type type) + +``` + +##### Returns + + +[YooAsset.AllAssetsHandle](/docs/2.3.x/api/YooAsset/AllAssetsHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.Type``*type*子对象类型 + +### LoadAllAssetsSync(string) + + +同步加载资源包内所有资源对象 + +Declaration +```csharp +public static AllAssetsHandle LoadAllAssetsSync(string location) + +``` + +##### Returns + + +[YooAsset.AllAssetsHandle](/docs/2.3.x/api/YooAsset/AllAssetsHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址 + +### LoadAllAssetsAsync(AssetInfo, uint) + + +异步加载资源包内所有资源对象 + +Declaration +```csharp +public static AllAssetsHandle LoadAllAssetsAsync(AssetInfo assetInfo, uint priority = 0) + +``` + +##### Returns + + +[YooAsset.AllAssetsHandle](/docs/2.3.x/api/YooAsset/AllAssetsHandle) + + +##### Parameters + +TypeNameDescription[YooAsset.AssetInfo](/docs/2.3.x/api/YooAsset/AssetInfo)*assetInfo*资源信息``System.UInt32``*priority* + +### LoadAllAssetsAsync(string, uint) + + +异步加载资源包内所有资源对象 + +Declaration +```csharp +public static AllAssetsHandle LoadAllAssetsAsync(string location, uint priority = 0) where TObject : Object + +``` + +##### Returns + + +[YooAsset.AllAssetsHandle](/docs/2.3.x/api/YooAsset/AllAssetsHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.UInt32``*priority* + +##### Type Parameters + +NameDescription``TObject``资源类型 + +### LoadAllAssetsAsync(string, Type, uint) + + +异步加载资源包内所有资源对象 + +Declaration +```csharp +public static AllAssetsHandle LoadAllAssetsAsync(string location, Type type, uint priority = 0) + +``` + +##### Returns + + +[YooAsset.AllAssetsHandle](/docs/2.3.x/api/YooAsset/AllAssetsHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.Type``*type*子对象类型``System.UInt32``*priority* + +### LoadAllAssetsAsync(string, uint) + + +异步加载资源包内所有资源对象 + +Declaration +```csharp +public static AllAssetsHandle LoadAllAssetsAsync(string location, uint priority = 0) + +``` + +##### Returns + + +[YooAsset.AllAssetsHandle](/docs/2.3.x/api/YooAsset/AllAssetsHandle) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.UInt32``*priority* + +### CreateResourceDownloader(int, int) + + +创建资源下载器,用于下载当前资源版本所有的资源包文件 + +Declaration +```csharp +public static ResourceDownloaderOperation CreateResourceDownloader(int downloadingMaxNumber, int failedTryAgain) + +``` + +##### Returns + + +[YooAsset.ResourceDownloaderOperation](/docs/2.3.x/api/YooAsset/ResourceDownloaderOperation) + + +##### Parameters + +TypeNameDescription``System.Int32``*downloadingMaxNumber*同时下载的最大文件数``System.Int32``*failedTryAgain*下载失败的重试次数 + +### CreateResourceDownloader(string, int, int) + + +创建资源下载器,用于下载指定的资源标签关联的资源包文件 + +Declaration +```csharp +public static ResourceDownloaderOperation CreateResourceDownloader(string tag, int downloadingMaxNumber, int failedTryAgain) + +``` + +##### Returns + + +[YooAsset.ResourceDownloaderOperation](/docs/2.3.x/api/YooAsset/ResourceDownloaderOperation) + + +##### Parameters + +TypeNameDescription``System.String``*tag*资源标签``System.Int32``*downloadingMaxNumber*同时下载的最大文件数``System.Int32``*failedTryAgain*下载失败的重试次数 + +### CreateResourceDownloader(string[], int, int) + + +创建资源下载器,用于下载指定的资源标签列表关联的资源包文件 + +Declaration +```csharp +public static ResourceDownloaderOperation CreateResourceDownloader(string[] tags, int downloadingMaxNumber, int failedTryAgain) + +``` + +##### Returns + + +[YooAsset.ResourceDownloaderOperation](/docs/2.3.x/api/YooAsset/ResourceDownloaderOperation) + + +##### Parameters + +TypeNameDescription``System.String[]``*tags*资源标签列表``System.Int32``*downloadingMaxNumber*同时下载的最大文件数``System.Int32``*failedTryAgain*下载失败的重试次数 + +### CreateBundleDownloader(string, int, int) + + +创建资源下载器,用于下载指定的资源依赖的资源包文件 + +Declaration +```csharp +public static ResourceDownloaderOperation CreateBundleDownloader(string location, int downloadingMaxNumber, int failedTryAgain) + +``` + +##### Returns + + +[YooAsset.ResourceDownloaderOperation](/docs/2.3.x/api/YooAsset/ResourceDownloaderOperation) + + +##### Parameters + +TypeNameDescription``System.String``*location*资源定位地址``System.Int32``*downloadingMaxNumber*同时下载的最大文件数``System.Int32``*failedTryAgain*下载失败的重试次数 + +### CreateBundleDownloader(string[], int, int) + + +创建资源下载器,用于下载指定的资源列表依赖的资源包文件 + +Declaration +```csharp +public static ResourceDownloaderOperation CreateBundleDownloader(string[] locations, int downloadingMaxNumber, int failedTryAgain) + +``` + +##### Returns + + +[YooAsset.ResourceDownloaderOperation](/docs/2.3.x/api/YooAsset/ResourceDownloaderOperation) + + +##### Parameters + +TypeNameDescription``System.String[]``*locations*资源定位地址列表``System.Int32``*downloadingMaxNumber*同时下载的最大文件数``System.Int32``*failedTryAgain*下载失败的重试次数 + +### CreateBundleDownloader(AssetInfo, int, int) + + +创建资源下载器,用于下载指定的资源依赖的资源包文件 + +Declaration +```csharp +public static ResourceDownloaderOperation CreateBundleDownloader(AssetInfo assetInfo, int downloadingMaxNumber, int failedTryAgain) + +``` + +##### Returns + + +[YooAsset.ResourceDownloaderOperation](/docs/2.3.x/api/YooAsset/ResourceDownloaderOperation) + + +##### Parameters + +TypeNameDescription[YooAsset.AssetInfo](/docs/2.3.x/api/YooAsset/AssetInfo)*assetInfo*资源信息``System.Int32``*downloadingMaxNumber*同时下载的最大文件数``System.Int32``*failedTryAgain*下载失败的重试次数 + +### CreateBundleDownloader(AssetInfo[], int, int) + + +创建资源下载器,用于下载指定的资源列表依赖的资源包文件 + +Declaration +```csharp +public static ResourceDownloaderOperation CreateBundleDownloader(AssetInfo[] assetInfos, int downloadingMaxNumber, int failedTryAgain) + +``` + +##### Returns + + +[YooAsset.ResourceDownloaderOperation](/docs/2.3.x/api/YooAsset/ResourceDownloaderOperation) + + +##### Parameters + +TypeNameDescription``YooAsset.AssetInfo[]``*assetInfos*资源信息列表``System.Int32``*downloadingMaxNumber*同时下载的最大文件数``System.Int32``*failedTryAgain*下载失败的重试次数 + +### CreateResourceUnpacker(int, int) + + +创建内置资源解压器,用于解压当前资源版本所有的资源包文件 + +Declaration +```csharp +public static ResourceUnpackerOperation CreateResourceUnpacker(int unpackingMaxNumber, int failedTryAgain) + +``` + +##### Returns + + +[YooAsset.ResourceUnpackerOperation](/docs/2.3.x/api/YooAsset/ResourceUnpackerOperation) + + +##### Parameters + +TypeNameDescription``System.Int32``*unpackingMaxNumber*同时解压的最大文件数``System.Int32``*failedTryAgain*解压失败的重试次数 + +### CreateResourceUnpacker(string, int, int) + + +创建内置资源解压器,用于解压指定的资源标签关联的资源包文件 + +Declaration +```csharp +public static ResourceUnpackerOperation CreateResourceUnpacker(string tag, int unpackingMaxNumber, int failedTryAgain) + +``` + +##### Returns + + +[YooAsset.ResourceUnpackerOperation](/docs/2.3.x/api/YooAsset/ResourceUnpackerOperation) + + +##### Parameters + +TypeNameDescription``System.String``*tag*资源标签``System.Int32``*unpackingMaxNumber*同时解压的最大文件数``System.Int32``*failedTryAgain*解压失败的重试次数 + +### CreateResourceUnpacker(string[], int, int) + + +创建内置资源解压器,用于解压指定的资源标签列表关联的资源包文件 + +Declaration +```csharp +public static ResourceUnpackerOperation CreateResourceUnpacker(string[] tags, int unpackingMaxNumber, int failedTryAgain) + +``` + +##### Returns + + +[YooAsset.ResourceUnpackerOperation](/docs/2.3.x/api/YooAsset/ResourceUnpackerOperation) + + +##### Parameters + +TypeNameDescription``System.String[]``*tags*资源标签列表``System.Int32``*unpackingMaxNumber*同时解压的最大文件数``System.Int32``*failedTryAgain*解压失败的重试次数 + +### CreateResourceImporter(string[], int, int) + + +创建资源导入器 +注意:资源文件名称必须和资源服务器部署的文件名称一致! + +Declaration +```csharp +public static ResourceImporterOperation CreateResourceImporter(string[] filePaths, int importerMaxNumber, int failedTryAgain) + +``` + +##### Returns + + +[YooAsset.ResourceImporterOperation](/docs/2.3.x/api/YooAsset/ResourceImporterOperation) + + +##### Parameters + +TypeNameDescription``System.String[]``*filePaths*资源路径列表``System.Int32``*importerMaxNumber*同时导入的最大文件数``System.Int32``*failedTryAgain*导入失败的重试次数 +--- + +# Class YooAssetSettingsData + + +###### **Assembly**: YooAsset.dll + +Declaration +```csharp +public static class YooAssetSettingsData + +``` + +## Methods + + +### GetDefaultYooFolderName() + + +获取YooAsset文件夹名称 + +Declaration +```csharp +public static string GetDefaultYooFolderName() + +``` + +##### Returns + + +``System.String`` + + +### GetBuildReportFileName(string, string) + + +获取构建报告文件名 + +Declaration +```csharp +public static string GetBuildReportFileName(string packageName, string packageVersion) + +``` + +##### Returns + + +``System.String`` + + +##### Parameters + +TypeName``System.String``*packageName*``System.String``*packageVersion* + +### GetManifestBinaryFileName(string, string) + + +获取清单文件完整名称 + +Declaration +```csharp +public static string GetManifestBinaryFileName(string packageName, string packageVersion) + +``` + +##### Returns + + +``System.String`` + + +##### Parameters + +TypeName``System.String``*packageName*``System.String``*packageVersion* + +### GetManifestJsonFileName(string, string) + + +获取清单文件完整名称 + +Declaration +```csharp +public static string GetManifestJsonFileName(string packageName, string packageVersion) + +``` + +##### Returns + + +``System.String`` + + +##### Parameters + +TypeName``System.String``*packageName*``System.String``*packageVersion* + +### GetPackageHashFileName(string, string) + + +获取包裹的哈希文件完整名称 + +Declaration +```csharp +public static string GetPackageHashFileName(string packageName, string packageVersion) + +``` + +##### Returns + + +``System.String`` + + +##### Parameters + +TypeName``System.String``*packageName*``System.String``*packageVersion* + +### GetPackageVersionFileName(string) + + +获取包裹的版本文件完整名称 + +Declaration +```csharp +public static string GetPackageVersionFileName(string packageName) + +``` + +##### Returns + + +``System.String`` + + +##### Parameters + +TypeName``System.String``*packageName* diff --git a/YooAsset_API/YooAsset_API_Reference_3.0.md b/YooAsset_API/YooAsset_API_Reference_3.0.md new file mode 100644 index 0000000..3f1817b --- /dev/null +++ b/YooAsset_API/YooAsset_API_Reference_3.0.md @@ -0,0 +1,9654 @@ +# YooAsset API Reference + +> Auto-generated from https://www.yooasset.com/docs/api/YooAsset/ +> Generated on 2026-06-09 16:40:00 + +--- +--- + +# Class AllAssetsHandle + + +全资源句柄,用于加载资源包内所有资源对象。 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Handles/AllAssetsHandle.cs#L9) + +Declaration +```csharp +public sealed class AllAssetsHandle : HandleBase, IEnumerator, IDisposable + +``` + +## Properties + + +### AllAssetObjects + + +所有资源对象集合 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Handles/AllAssetsHandle.cs#L56) + +Declaration +```csharp +public IReadOnlyList AllAssetObjects { get; } + +``` + +## Methods + + +### WaitForAsyncComplete() + + +等待异步执行完毕 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Handles/AllAssetsHandle.cs#L46) + +Declaration +```csharp +public void WaitForAsyncComplete() + +``` + +## Events + + +### Completed + + +当加载完成时触发 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Handles/AllAssetsHandle.cs#L24) + +Declaration +```csharp +public event Action Completed + +``` + +##### Event Type + + +``System.Action`` + + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IDisposable`` +--- + +# Class AssetHandle + + +资源句柄,用于管理单个资源对象的加载和访问。 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Handles/AssetHandle.cs#L8) + +Declaration +```csharp +public sealed class AssetHandle : HandleBase, IEnumerator, IDisposable + +``` + +## Properties + + +### AssetObject + + +资源对象 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Handles/AssetHandle.cs#L56) + +Declaration +```csharp +public Object AssetObject { get; } + +``` + +## Methods + + +### WaitForAsyncComplete() + + +等待异步执行完毕 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Handles/AssetHandle.cs#L45) + +Declaration +```csharp +public void WaitForAsyncComplete() + +``` + +### GetAssetObject() + + +获取资源对象 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Handles/AssetHandle.cs#L71) + +Declaration +```csharp +public TAsset GetAssetObject() where TAsset : Object + +``` + +##### Returns + + +````: 资源对象,如果句柄无效则返回 null。##### Type Parameters + +NameDescription``TAsset``资源类型 + +### InstantiateSync() + + +同步实例化游戏对象 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Handles/AssetHandle.cs#L82) + +Declaration +```csharp +public GameObject InstantiateSync() + +``` + +##### Returns + + +``UnityEngine.GameObject``: 实例化的游戏对象### InstantiateSync(InstantiateOptions) +同步实例化游戏对象 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Handles/AssetHandle.cs#L93) + +Declaration +```csharp +public GameObject InstantiateSync(InstantiateOptions options) + +``` + +##### Returns + + +``UnityEngine.GameObject``: 实例化的游戏对象 + + +##### Parameters + +TypeNameDescription[YooAsset.InstantiateOptions](/docs/api/YooAsset/InstantiateOptions)*options*实例化选项 + +### InstantiateAsync() + + +实例化游戏对象 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Handles/AssetHandle.cs#L102) + +Declaration +```csharp +public InstantiateOperation InstantiateAsync() + +``` + +##### Returns + + +[YooAsset.InstantiateOperation](/docs/api/YooAsset/InstantiateOperation): 实例化操作### InstantiateAsync(InstantiateOptions) +实例化游戏对象 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Handles/AssetHandle.cs#L113) + +Declaration +```csharp +public InstantiateOperation InstantiateAsync(InstantiateOptions options) + +``` + +##### Returns + + +[YooAsset.InstantiateOperation](/docs/api/YooAsset/InstantiateOperation): 实例化操作 + + +##### Parameters + +TypeNameDescription[YooAsset.InstantiateOptions](/docs/api/YooAsset/InstantiateOptions)*options*实例化选项 + +## Events + + +### Completed + + +当加载完成时触发 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Handles/AssetHandle.cs#L23) + +Declaration +```csharp +public event Action Completed + +``` + +##### Event Type + + +``System.Action`` + + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IDisposable`` +--- + +# Class AssetInfo + + +资源信息类 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/AssetInfo.cs#L43) + +Declaration +```csharp +public class AssetInfo + +``` + +## Properties + + +### PackageName + + +所属包裹 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/AssetInfo.cs#L51) + +Declaration +```csharp +public string PackageName { get; } + +``` + +### AssetType + + +资源类型 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/AssetInfo.cs#L56) + +Declaration +```csharp +public Type AssetType { get; } + +``` + +### Error + + +错误信息 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/AssetInfo.cs#L61) + +Declaration +```csharp +public string Error { get; } + +``` + +### IsValid + + +资源信息是否有效 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/AssetInfo.cs#L94) + +Declaration +```csharp +public bool IsValid { get; } + +``` + +### Address + + +可寻址地址 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/AssetInfo.cs#L105) + +Declaration +```csharp +public string Address { get; } + +``` + +### AssetPath + + +资源路径 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/AssetInfo.cs#L118) + +Declaration +```csharp +public string AssetPath { get; } + +``` +--- + +# Class AsyncOperationBase + + +异步操作基类 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/AsyncOperation/AsyncOperationBase.cs#L11) + +Declaration +```csharp +public abstract class AsyncOperationBase : IEnumerator, IComparable + +``` + +## Properties + + +### IsBusy + + +当前帧时间切片是否已用完 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/AsyncOperation/AsyncOperationBase.cs#L41) + +Declaration +```csharp +protected bool IsBusy { get; } + +``` + +### Priority + + +任务优先级(值越大越优先执行) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/AsyncOperation/AsyncOperationBase.cs#L55) + +Declaration +```csharp +public uint Priority { get; set; } + +``` + +### Progress + + +异步操作的处理进度(0f - 1f) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/AsyncOperation/AsyncOperationBase.cs#L73) + +Declaration +```csharp +public float Progress { get; protected set; } + +``` + +### IsDone + + +异步操作是否已结束 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/AsyncOperation/AsyncOperationBase.cs#L78) + +Declaration +```csharp +public bool IsDone { get; } + +``` + +### Error + + +操作失败时的错误描述 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/AsyncOperation/AsyncOperationBase.cs#L89) + +Declaration +```csharp +public string Error { get; } + +``` + +### Status + + +异步操作的当前状态 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/AsyncOperation/AsyncOperationBase.cs#L97) + +Declaration +```csharp +public EOperationStatus Status { get; } + +``` + +## Methods + + +### WaitForCompletion() + + +同步等待异步执行完毕 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/AsyncOperation/AsyncOperationBase.cs#L162) + +Declaration +```csharp +public void WaitForCompletion() + +``` + +### InternalStart() + + +内部启动方法(子类必须实现) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/AsyncOperation/AsyncOperationBase.cs#L285) + +Declaration +```csharp +protected abstract void InternalStart() + +``` + +### InternalUpdate() + + +内部更新方法(子类必须实现) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/AsyncOperation/AsyncOperationBase.cs#L290) + +Declaration +```csharp +protected abstract void InternalUpdate() + +``` + +### InternalAbort() + + +内部中止方法(子类可选实现) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/AsyncOperation/AsyncOperationBase.cs#L295) + +Declaration +```csharp +protected virtual void InternalAbort() + +``` + +### InternalDispose() + + +内部释放方法(子类可选实现) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/AsyncOperation/AsyncOperationBase.cs#L302) + +Declaration +```csharp +protected virtual void InternalDispose() + +``` + +### InternalGetDescription() + + +获取操作的描述信息(子类可选实现) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/AsyncOperation/AsyncOperationBase.cs#L310) + +Declaration +```csharp +protected virtual string InternalGetDescription() + +``` + +##### Returns + + +``System.String``: 操作的描述字符串,默认返回空字符串。### InternalWaitForCompletion() +内部同步等待方法(子类可选实现) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/AsyncOperation/AsyncOperationBase.cs#L321) + +Declaration +```csharp +protected virtual void InternalWaitForCompletion() + +``` + +### SetResult() + + +将操作标记为成功完成 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/AsyncOperation/AsyncOperationBase.cs#L330) + +Declaration +```csharp +protected void SetResult() + +``` + +### SetError(string) + + +将操作标记为失败 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/AsyncOperation/AsyncOperationBase.cs#L342) + +Declaration +```csharp +protected void SetError(string error) + +``` + +##### Parameters + +TypeNameDescription``System.String``*error*错误描述 + +### CalculateMultiStageProgress(int, int, int, int) + + +计算多阶段操作的整体进度 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/AsyncOperation/AsyncOperationBase.cs#L359) + +Declaration +```csharp +protected float CalculateMultiStageProgress(int stageIndex, int stageCount, int remaining, int total) + +``` + +##### Returns + + +``System.Single``: 返回归一化的整体进度值(0-1) + + +##### Parameters + +TypeNameDescription``System.Int32``*stageIndex*当前阶段索引(从0开始)``System.Int32``*stageCount*阶段总数``System.Int32``*remaining*当前阶段剩余工作量``System.Int32``*total*当前阶段总工作量 + +### AddChildOperation(AsyncOperationBase) + + +添加子任务 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/AsyncOperation/AsyncOperationBase.cs#L371) + +Declaration +```csharp +protected void AddChildOperation(AsyncOperationBase child) + +``` + +##### Parameters + +TypeNameDescription[YooAsset.AsyncOperationBase](/docs/api/YooAsset/AsyncOperationBase)*child*要添加的子任务 + +### RemoveChildOperation(AsyncOperationBase) + + +移除子任务 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/AsyncOperation/AsyncOperationBase.cs#L398) + +Declaration +```csharp +protected void RemoveChildOperation(AsyncOperationBase child) + +``` + +##### Parameters + +TypeNameDescription[YooAsset.AsyncOperationBase](/docs/api/YooAsset/AsyncOperationBase)*child*要移除的子任务 + +### ExecuteOnce() + + +执行一次更新逻辑 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/AsyncOperation/AsyncOperationBase.cs#L417) + +Declaration +```csharp +protected void ExecuteOnce() + +``` + +### ExecuteBatch(int) + + +批量执行一定次数的更新逻辑 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/AsyncOperation/AsyncOperationBase.cs#L432) + +Declaration +```csharp +protected void ExecuteBatch(int count = 1000) + +``` + +##### Parameters + +TypeNameDescription``System.Int32``*count*最大执行次数,默认1000次。 + +### ExecuteUntilComplete(int) + + +循环执行更新逻辑直到操作完成 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/AsyncOperation/AsyncOperationBase.cs#L457) + +Declaration +```csharp +protected void ExecuteUntilComplete(int sleepMilliseconds = 1) + +``` + +##### Parameters + +TypeNameDescription``System.Int32``*sleepMilliseconds*每次循环后的休眠时长(毫秒) + +### CompareTo(AsyncOperationBase) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/AsyncOperation/AsyncOperationBase.cs#L672) + +Declaration +```csharp +public int CompareTo(AsyncOperationBase other) + +``` + +##### Returns + + +``System.Int32`` + + +##### Parameters + +TypeName[YooAsset.AsyncOperationBase](/docs/api/YooAsset/AsyncOperationBase)*other* + +### GetAwaiter() + + +获取用于 async/await 的等待器 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/AsyncOperation/AsyncOperationBase.cs#L683) + +Declaration +```csharp +public OperationAwaiter GetAwaiter() + +``` + +##### Returns + + +[YooAsset.OperationAwaiter](/docs/api/YooAsset/OperationAwaiter): 当前操作的等待器## Events + + +### Completed + + +异步操作的完成事件 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/AsyncOperation/AsyncOperationBase.cs#L108) + +Declaration +```csharp +public event Action Completed + +``` + +##### Event Type + + +``System.Action`` + + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IComparable`` +--- + +# Struct BundleDecryptArgs + + +资源包解密操作的输入参数 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IBundleDecryptor.cs#L9) + +Declaration +```csharp +public readonly struct BundleDecryptArgs + +``` + +## Properties + + +### FileData + + +资源包的二进制数据 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IBundleDecryptor.cs#L22) + +Declaration +```csharp +public byte[] FileData { get; } + +``` + +### FilePath + + +资源包的文件路径 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IBundleDecryptor.cs#L27) + +Declaration +```csharp +public string FilePath { get; } + +``` +--- + +# Struct BundleDownloaderOptions + + +按资源信息创建下载器的操作选项 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderOptions.cs#L7) + +Declaration +```csharp +public readonly struct BundleDownloaderOptions + +``` + +## Properties + + +### MaximumConcurrency + + +最大并发数量 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderOptions.cs#L12) + +Declaration +```csharp +public int MaximumConcurrency { get; } + +``` + +### RetryCount + + +失败后的重试次数 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderOptions.cs#L17) + +Declaration +```csharp +public int RetryCount { get; } + +``` + +### DownloadBundleDependencies + + +下载资源对象所属资源包内所有资源对象依赖的资源包 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderOptions.cs#L22) + +Declaration +```csharp +public bool DownloadBundleDependencies { get; } + +``` + +### AssetInfos + + +资源信息列表 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderOptions.cs#L28) + +Declaration +```csharp +public AssetInfo[] AssetInfos { get; } + +``` +--- + +# Struct BundleEncryptArgs + + +资源包加密操作的输入参数 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IBundleEncryptor.cs#L7) + +Declaration +```csharp +public readonly struct BundleEncryptArgs + +``` + +## Properties + + +### FilePath + + +待加密的源文件路径 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IBundleEncryptor.cs#L17) + +Declaration +```csharp +public string FilePath { get; } + +``` +--- + +# Struct BundleEncryptResult + + +资源包加密操作的返回结果 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IBundleEncryptor.cs#L34) + +Declaration +```csharp +public readonly struct BundleEncryptResult + +``` + +## Properties + + +### IsEncrypted + + +文件是否已加密 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IBundleEncryptor.cs#L39) + +Declaration +```csharp +public bool IsEncrypted { get; } + +``` + +### EncryptedFileData + + +加密后的文件数据 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IBundleEncryptor.cs#L44) + +Declaration +```csharp +public byte[] EncryptedFileData { get; } + +``` +--- + +# Class BundleFileHandle + + +资源包文件句柄,用于持有已加载的资源包引用。 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Handles/BundleFileHandle.cs#L7) + +Declaration +```csharp +public sealed class BundleFileHandle : HandleBase, IEnumerator, IDisposable + +``` + +## Methods + + +### WaitForAsyncComplete() + + +等待异步执行完毕 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Handles/BundleFileHandle.cs#L44) + +Declaration +```csharp +public void WaitForAsyncComplete() + +``` + +## Events + + +### Completed + + +当加载完成时触发 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Handles/BundleFileHandle.cs#L22) + +Declaration +```csharp +public event Action Completed + +``` + +##### Event Type + + +``System.Action`` + + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IDisposable`` +--- + +# Struct BundleImporterOptions + + +资源导入的操作选项 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderOptions.cs#L184) + +Declaration +```csharp +public readonly struct BundleImporterOptions + +``` + +## Properties + + +### MaximumConcurrency + + +最大并发数量 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderOptions.cs#L189) + +Declaration +```csharp +public int MaximumConcurrency { get; } + +``` + +### RetryCount + + +失败后的重试次数 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderOptions.cs#L194) + +Declaration +```csharp +public int RetryCount { get; } + +``` + +### BundleInfos + + +资源包信息列表 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderOptions.cs#L199) + +Declaration +```csharp +public ImportBundleInfo[] BundleInfos { get; } + +``` +--- + +# Struct BundleUnpackInfo + + +资源包解包判定信息 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IBundleUnpackPolicy.cs#L7) + +Declaration +```csharp +public readonly struct BundleUnpackInfo + +``` + +## Properties + + +### BundleName + + +资源包名称 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IBundleUnpackPolicy.cs#L14) + +Declaration +```csharp +public string BundleName { get; } + +``` + +### FileName + + +资源包文件名称 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IBundleUnpackPolicy.cs#L19) + +Declaration +```csharp +public string FileName { get; } + +``` + +### BundleType + + +资源包类型 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IBundleUnpackPolicy.cs#L24) + +Declaration +```csharp +public int BundleType { get; } + +``` + +### IsEncrypted + + +是否为加密资源包 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IBundleUnpackPolicy.cs#L29) + +Declaration +```csharp +public bool IsEncrypted { get; } + +``` + +### TagCount + + +分类标签数量 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IBundleUnpackPolicy.cs#L34) + +Declaration +```csharp +public int TagCount { get; } + +``` + +## Methods + + +### GetTag(int) + + +获取指定索引的分类标签 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IBundleUnpackPolicy.cs#L50) + +Declaration +```csharp +public string GetTag(int index) + +``` + +##### Returns + + +``System.String`` + + +##### Parameters + +TypeName``System.Int32``*index* + +### HasTag(string) + + +是否包含指定的单个标签 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IBundleUnpackPolicy.cs#L58) + +Declaration +```csharp +public bool HasTag(string tag) + +``` + +##### Returns + + +``System.Boolean`` + + +##### Parameters + +TypeName``System.String``*tag* + +### HasAnyTag(string[]) + + +是否包含指定标签数组中的任意一个 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IBundleUnpackPolicy.cs#L66) + +Declaration +```csharp +public bool HasAnyTag(string[] tags) + +``` + +##### Returns + + +``System.Boolean`` + + +##### Parameters + +TypeName``System.String[]``*tags* +--- + +# Class ClearCacheMethods + + +缓存清理方式标识符 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/ClearCacheMethods.cs#L7) + +Declaration +```csharp +public static class ClearCacheMethods + +``` + +## Fields + + +### ClearAllBundleFiles + + +清理所有资源包文件 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/ClearCacheMethods.cs#L12) + +Declaration +```csharp +public const string ClearAllBundleFiles = "ClearAllBundleFiles" + +``` + +### ClearUnusedBundleFiles + + +清理未在使用的资源包文件 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/ClearCacheMethods.cs#L17) + +Declaration +```csharp +public const string ClearUnusedBundleFiles = "ClearUnusedBundleFiles" + +``` + +### ClearBundleFilesByLocations + + +清理指定地址的资源包文件 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/ClearCacheMethods.cs#L22) + +Declaration +```csharp +public const string ClearBundleFilesByLocations = "ClearBundleFilesByLocations" + +``` + +### ClearBundleFilesByTags + + +清理指定标签的资源包文件 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/ClearCacheMethods.cs#L27) + +Declaration +```csharp +public const string ClearBundleFilesByTags = "ClearBundleFilesByTags" + +``` + +### ClearAllManifestFiles + + +清理所有清单文件 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/ClearCacheMethods.cs#L32) + +Declaration +```csharp +public const string ClearAllManifestFiles = "ClearAllManifestFiles" + +``` + +### ClearUnusedManifestFiles + + +清理未在使用的清单文件 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/ClearCacheMethods.cs#L37) + +Declaration +```csharp +public const string ClearUnusedManifestFiles = "ClearUnusedManifestFiles" + +``` +--- + +# Class ClearCacheOperation + + +清理缓存操作 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/ClearCacheOperation.cs#L9) + +Declaration +```csharp +public sealed class ClearCacheOperation : AsyncOperationBase, IEnumerator, IComparable + +``` + +## Methods + + +### InternalStart() + + +内部启动方法(子类必须实现) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/ClearCacheOperation.cs#L32) + +Declaration +```csharp +protected override void InternalStart() + +``` + +### InternalUpdate() + + +内部更新方法(子类必须实现) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/ClearCacheOperation.cs#L37) + +Declaration +```csharp +protected override void InternalUpdate() + +``` + +### InternalGetDescription() + + +获取操作的描述信息(子类可选实现) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/ClearCacheOperation.cs#L104) + +Declaration +```csharp +protected override string InternalGetDescription() + +``` + +##### Returns + + +``System.String``: 操作的描述字符串,默认返回空字符串。 + + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IComparable`` +--- + +# Struct ClearCacheOptions + + +清理缓存的操作选项 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/ClearCacheOptions.cs#L7) + +Declaration +```csharp +public readonly struct ClearCacheOptions + +``` + +## Properties + + +### ClearMethod + + +清理方式 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/ClearCacheOptions.cs#L12) + +Declaration +```csharp +public string ClearMethod { get; } + +``` + +### ClearParameter + + +附加参数 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/ClearCacheOptions.cs#L17) + +Declaration +```csharp +public object ClearParameter { get; } + +``` +--- + +# Class CustomPlayModeOptions + + +自定义运行模式的操作选项 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/InitializePackageOptions.cs#L83) + +Declaration +```csharp +public class CustomPlayModeOptions : InitializePackageOptions + +``` + +## Fields + + +### FileSystemParameterList + + +文件系统初始化参数列表 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/InitializePackageOptions.cs#L89) + +Declaration +```csharp +public readonly List FileSystemParameterList + +``` +--- + +# Class DefaultDownloadRetryPolicy + + +默认的下载重试策略 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/DownloadSystem/Policies/DefaultDownloadRetryPolicy.cs#L8) + +Declaration +```csharp +public class DefaultDownloadRetryPolicy : IDownloadRetryPolicy + +``` + +## Methods + + +### IsRetryableError(string, long, string) + + +判断本次下载失败是否属于可重试的错误 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/DownloadSystem/Policies/DefaultDownloadRetryPolicy.cs#L20) + +Declaration +```csharp +public bool IsRetryableError(string url, long httpCode, string httpError) + +``` + +##### Returns + + +``System.Boolean``: 如果该错误可以重试则返回 true,否则返回 false。 + + +##### Parameters + +TypeNameDescription``System.String``*url*失败请求的 URL``System.Int64``*httpCode*HTTP 响应状态码``System.String``*httpError*HTTP 错误信息 + +### CalculateRetryDelay(int, float) + + +计算重试等待时长(秒) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/DownloadSystem/Policies/DefaultDownloadRetryPolicy.cs#L57) + +Declaration +```csharp +public float CalculateRetryDelay(int retryCount, float previousDelay) + +``` + +##### Returns + + +``System.Single``: 本次重试前的等待时长(秒) + + +##### Parameters + +TypeNameDescription``System.Int32``*retryCount*当前已重试次数``System.Single``*previousDelay*上一次的等待时长(秒) + +## Implements + +- [YooAsset.IDownloadRetryPolicy](/docs/api/YooAsset/IDownloadRetryPolicy) +--- + +# Class DefaultDownloadUrlPolicy + + +默认的 URL 选择策略 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/DownloadSystem/Policies/DefaultDownloadUrlPolicy.cs#L12) + +Declaration +```csharp +public class DefaultDownloadUrlPolicy : IDownloadUrlPolicy + +``` + +## Methods + + +### SelectUrl(IReadOnlyList) + + +基于内部失败计数轮转选择 URL + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/DownloadSystem/Policies/DefaultDownloadUrlPolicy.cs#L21) + +Declaration +```csharp +public string SelectUrl(IReadOnlyList candidateUrls) + +``` + +##### Returns + + +``System.String``: 选中的 URL + + +##### Parameters + +TypeNameDescription``System.Collections.Generic.IReadOnlyList``*candidateUrls*候选 URL 列表 + +### OnRequestSucceeded(string) + + +请求成功反馈,保持当前 URL 不变。 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/DownloadSystem/Policies/DefaultDownloadUrlPolicy.cs#L34) + +Declaration +```csharp +public void OnRequestSucceeded(string url) + +``` + +##### Parameters + +TypeNameDescription``System.String``*url*成功请求的 URL + +### OnRequestFailed(string, long, string) + + +请求失败反馈,递增失败计数以切换 URL。 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/DownloadSystem/Policies/DefaultDownloadUrlPolicy.cs#L44) + +Declaration +```csharp +public void OnRequestFailed(string url, long httpCode, string httpError) + +``` + +##### Parameters + +TypeNameDescription``System.String``*url*失败请求的 URL``System.Int64``*httpCode*HTTP 响应状态码``System.String``*httpError*HTTP 错误信息 + +## Implements + +- [YooAsset.IDownloadUrlPolicy](/docs/api/YooAsset/IDownloadUrlPolicy) +--- + +# Class DestroyPackageOperation + + +销毁资源包裹操作 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DestroyPackageOperation.cs#L7) + +Declaration +```csharp +public sealed class DestroyPackageOperation : AsyncOperationBase, IEnumerator, IComparable + +``` + +## Methods + + +### InternalStart() + + +内部启动方法(子类必须实现) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DestroyPackageOperation.cs#L33) + +Declaration +```csharp +protected override void InternalStart() + +``` + +### InternalUpdate() + + +内部更新方法(子类必须实现) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DestroyPackageOperation.cs#L38) + +Declaration +```csharp +protected override void InternalUpdate() + +``` + +### InternalGetDescription() + + +获取操作的描述信息(子类可选实现) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DestroyPackageOperation.cs#L111) + +Declaration +```csharp +protected override string InternalGetDescription() + +``` + +##### Returns + + +``System.String``: 操作的描述字符串,默认返回空字符串。 + + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IComparable`` +--- + +# Struct DownloadCompletedEventArgs + + +下载完成事件参数 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderEventArgs.cs#L7) + +Declaration +```csharp +public readonly struct DownloadCompletedEventArgs + +``` + +## Properties + + +### PackageName + + +所属包裹名称 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderEventArgs.cs#L12) + +Declaration +```csharp +public string PackageName { get; } + +``` + +### Succeeded + + +是否成功 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderEventArgs.cs#L17) + +Declaration +```csharp +public bool Succeeded { get; } + +``` + +### Error + + +下载失败时的错误信息 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderEventArgs.cs#L22) + +Declaration +```csharp +public string Error { get; } + +``` +--- + +# Class DownloaderOperation + + +下载操作基类,提供资源下载、暂停、恢复和取消功能。 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderOperation.cs#L9) + +Declaration +```csharp +public abstract class DownloaderOperation : AsyncOperationBase, IEnumerator, IComparable + +``` + +## Properties + + +### TotalDownloadCount + + +统计的下载文件总数量 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderOperation.cs#L41) + +Declaration +```csharp +public int TotalDownloadCount { get; } + +``` + +### TotalDownloadBytes + + +统计的下载文件的总大小 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderOperation.cs#L46) + +Declaration +```csharp +public long TotalDownloadBytes { get; } + +``` + +### CurrentDownloadCount + + +当前已经完成的下载总数量 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderOperation.cs#L51) + +Declaration +```csharp +public int CurrentDownloadCount { get; } + +``` + +### CurrentDownloadBytes + + +当前已经完成的下载总大小 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderOperation.cs#L59) + +Declaration +```csharp +public long CurrentDownloadBytes { get; } + +``` + +## Methods + + +### InternalStart() + + +内部启动方法(子类必须实现) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderOperation.cs#L103) + +Declaration +```csharp +protected override void InternalStart() + +``` + +### InternalUpdate() + + +内部更新方法(子类必须实现) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderOperation.cs#L109) + +Declaration +```csharp +protected override void InternalUpdate() + +``` + +### Combine(DownloaderOperation) + + +合并其它下载器 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderOperation.cs#L317) + +Declaration +```csharp +public void Combine(DownloaderOperation downloader) + +``` + +##### Parameters + +TypeNameDescription[YooAsset.DownloaderOperation](/docs/api/YooAsset/DownloaderOperation)*downloader*合并的下载器 + +### StartDownload() + + +开始下载 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderOperation.cs#L358) + +Declaration +```csharp +public void StartDownload() + +``` + +### PauseDownload() + + +暂停下载 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderOperation.cs#L369) + +Declaration +```csharp +public void PauseDownload() + +``` + +### ResumeDownload() + + +恢复下载 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderOperation.cs#L377) + +Declaration +```csharp +public void ResumeDownload() + +``` + +### CancelDownload() + + +取消下载 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderOperation.cs#L385) + +Declaration +```csharp +public void CancelDownload() + +``` + +## Events + + +### DownloadCompleted + + +当下载完成时触发(无论成功或失败)。 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderOperation.cs#L67) + +Declaration +```csharp +public event Action DownloadCompleted + +``` + +##### Event Type + + +``System.Action`` + + +### DownloadProgressChanged + + +当下载进度更新时触发 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderOperation.cs#L72) + +Declaration +```csharp +public event Action DownloadProgressChanged + +``` + +##### Event Type + + +``System.Action`` + + +### DownloadError + + +当发生下载错误时触发 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderOperation.cs#L77) + +Declaration +```csharp +public event Action DownloadError + +``` + +##### Event Type + + +``System.Action`` + + +### DownloadFileStarted + + +当开始下载单个文件时触发 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderOperation.cs#L82) + +Declaration +```csharp +public event Action DownloadFileStarted + +``` + +##### Event Type + + +``System.Action`` + + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IComparable`` +--- + +# Struct DownloadErrorEventArgs + + +下载错误事件参数 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderEventArgs.cs#L120) + +Declaration +```csharp +public readonly struct DownloadErrorEventArgs + +``` + +## Properties + + +### PackageName + + +所属包裹名称 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderEventArgs.cs#L125) + +Declaration +```csharp +public string PackageName { get; } + +``` + +### FileName + + +下载失败的文件名称 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderEventArgs.cs#L130) + +Declaration +```csharp +public string FileName { get; } + +``` + +### ErrorInfo + + +错误信息 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderEventArgs.cs#L135) + +Declaration +```csharp +public string ErrorInfo { get; } + +``` +--- + +# Struct DownloadFileStartedEventArgs + + +开始下载单个文件事件参数 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderEventArgs.cs#L154) + +Declaration +```csharp +public readonly struct DownloadFileStartedEventArgs + +``` + +## Properties + + +### PackageName + + +所属包裹名称 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderEventArgs.cs#L159) + +Declaration +```csharp +public string PackageName { get; } + +``` + +### BundleName + + +资源包名称 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderEventArgs.cs#L164) + +Declaration +```csharp +public string BundleName { get; } + +``` + +### FileName + + +文件名称 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderEventArgs.cs#L169) + +Declaration +```csharp +public string FileName { get; } + +``` + +### FileSize + + +文件大小 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderEventArgs.cs#L174) + +Declaration +```csharp +public long FileSize { get; } + +``` +--- + +# Struct DownloadProgressChangedEventArgs + + +下载进度更新事件参数 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderEventArgs.cs#L63) + +Declaration +```csharp +public readonly struct DownloadProgressChangedEventArgs + +``` + +## Properties + + +### PackageName + + +所属包裹名称 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderEventArgs.cs#L68) + +Declaration +```csharp +public string PackageName { get; } + +``` + +### Progress + + +下载进度 (0-1f) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderEventArgs.cs#L73) + +Declaration +```csharp +public float Progress { get; } + +``` + +### TotalDownloadCount + + +下载文件总数 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderEventArgs.cs#L78) + +Declaration +```csharp +public int TotalDownloadCount { get; } + +``` + +### TotalDownloadBytes + + +下载数据总大小(单位:字节) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderEventArgs.cs#L83) + +Declaration +```csharp +public long TotalDownloadBytes { get; } + +``` + +### CurrentDownloadCount + + +当前完成的下载文件数量 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderEventArgs.cs#L88) + +Declaration +```csharp +public int CurrentDownloadCount { get; } + +``` + +### CurrentDownloadBytes + + +当前完成的下载数据大小(单位:字节) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderEventArgs.cs#L93) + +Declaration +```csharp +public long CurrentDownloadBytes { get; } + +``` +--- + +# Struct DownloadReport + + +下载状态报告 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/DownloadSystem/DownloadReport.cs#L7) + +Declaration +```csharp +public readonly struct DownloadReport + +``` + +## Properties + + +### HttpCode + + +HTTP 响应状态码 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/DownloadSystem/DownloadReport.cs#L12) + +Declaration +```csharp +public long HttpCode { get; } + +``` + +### HttpError + + +HTTP 错误信息 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/DownloadSystem/DownloadReport.cs#L17) + +Declaration +```csharp +public string HttpError { get; } + +``` + +### DownloadedBytes + + +当前下载的字节数 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/DownloadSystem/DownloadReport.cs#L22) + +Declaration +```csharp +public long DownloadedBytes { get; } + +``` + +### DownloadProgress + + +当前下载进度(0f - 1f) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/DownloadSystem/DownloadReport.cs#L27) + +Declaration +```csharp +public float DownloadProgress { get; } + +``` + +## Fields + + +### Empty + + +空的下载报告实例(所有字段为默认值) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/DownloadSystem/DownloadReport.cs#L32) + +Declaration +```csharp +public static readonly DownloadReport Empty + +``` + +## Methods + + +### CreateProgress(long, float) + + +创建下载进度报告 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/DownloadSystem/DownloadReport.cs#L55) + +Declaration +```csharp +public static DownloadReport CreateProgress(long downloadedBytes, float downloadProgress) + +``` + +##### Returns + + +[YooAsset.DownloadReport](/docs/api/YooAsset/DownloadReport): 不含 HTTP 状态信息的进度报告 + + +##### Parameters + +TypeNameDescription``System.Int64``*downloadedBytes*已下载的字节数``System.Single``*downloadProgress*下载进度,取值范围 0f ~ 1f + +### CreateFinished(long, string, long, float) + + +创建包含 HTTP 状态的最终报告(成功或失败) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/DownloadSystem/DownloadReport.cs#L72) + +Declaration +```csharp +public static DownloadReport CreateFinished(long httpCode, string httpError, long downloadedBytes, float downloadProgress) + +``` + +##### Returns + + +[YooAsset.DownloadReport](/docs/api/YooAsset/DownloadReport): 包含完整 HTTP 状态信息的最终报告 + + +##### Parameters + +TypeNameDescription``System.Int64``*httpCode*HTTP 响应状态码``System.String``*httpError*HTTP 错误信息,成功时为 null。``System.Int64``*downloadedBytes*已下载的字节数``System.Single``*downloadProgress*下载进度,取值范围 0f ~ 1f +--- + +# Enum EBundleType + + +资源包的类型 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/BundleHandle/EBundleType.cs#L8) + +Declaration +```csharp +public enum EBundleType + +``` + +## Fields + + +### None + + +未指定类型 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/BundleHandle/EBundleType.cs#L13) + +Declaration +```csharp +None = 0 + +``` + +### AssetBundle + + +Unity引擎资源包 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/BundleHandle/EBundleType.cs#L18) + +Declaration +```csharp +AssetBundle = 2 + +``` + +### RawBundle + + +原生文件资源包 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/BundleHandle/EBundleType.cs#L23) + +Declaration +```csharp +RawBundle = 3 + +``` + +### ArchiveBundle + + +归档文件资源包 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/BundleHandle/EBundleType.cs#L28) + +Declaration +```csharp +ArchiveBundle = 4 + +``` + +### InstantBundle + + +团结引擎资源包 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/BundleHandle/EBundleType.cs#L33) + +Declaration +```csharp +InstantBundle = 5 + +``` + +### VirtualAssetBundle + + +虚拟 Unity 引擎资源包(编辑器模拟 AssetBundle) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/BundleHandle/EBundleType.cs#L39) + +Declaration +```csharp +VirtualAssetBundle = 12 + +``` + +### VirtualRawBundle + + +虚拟原生文件资源包(编辑器模拟 RawBundle) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/BundleHandle/EBundleType.cs#L44) + +Declaration +```csharp +VirtualRawBundle = 13 + +``` + +### VirtualArchiveBundle + + +虚拟归档文件资源包(编辑器模拟 ArchiveBundle) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/BundleHandle/EBundleType.cs#L49) + +Declaration +```csharp +VirtualArchiveBundle = 14 + +``` +--- + +# Class EditorSimulateBuildInvoker + + +编辑器模拟构建的调用入口 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/PackageBuilder/EditorSimulateBuildInvoker.cs#L8) + +Declaration +```csharp +public static class EditorSimulateBuildInvoker + +``` + +## Methods + + +### Build(string, int) + + +执行编辑器模拟构建 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/PackageBuilder/EditorSimulateBuildInvoker.cs#L19) + +Declaration +```csharp +public static PackageBuildResult Build(string packageName, int buildBundleType) + +``` + +##### Returns + + +[YooAsset.PackageBuildResult](/docs/api/YooAsset/PackageBuildResult): 构建结果 + + +##### Parameters + +TypeNameDescription``System.String``*packageName*包裹名称``System.Int32``*buildBundleType*构建资源包类型 +--- + +# Class EditorSimulateModeOptions + + +编辑器下模拟运行模式的操作选项 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/InitializePackageOptions.cs#L29) + +Declaration +```csharp +public class EditorSimulateModeOptions : InitializePackageOptions + +``` + +## Properties + + +### EditorFileSystemParameters + + +编辑器文件系统初始化参数 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/InitializePackageOptions.cs#L34) + +Declaration +```csharp +public FileSystemParameters EditorFileSystemParameters { get; set; } + +``` +--- + +# Enum EFileNameStyle + + +远端资源文件命名风格 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/EFileNameStyle.cs#L7) + +Declaration +```csharp +public enum EFileNameStyle + +``` + +## Fields + + +### HashName + + +哈希值名称 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/EFileNameStyle.cs#L12) + +Declaration +```csharp +HashName = 0 + +``` + +### BundleName + + +资源包名称(不推荐) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/EFileNameStyle.cs#L17) + +Declaration +```csharp +BundleName = 1 + +``` + +### BundleName_HashName + + +资源包名称 + 哈希值名称 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/EFileNameStyle.cs#L22) + +Declaration +```csharp +BundleName_HashName = 2 + +``` +--- + +# Enum EFileSystemParameter + + +文件系统参数类型定义 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/EFileSystemParameter.cs#L7) + +Declaration +```csharp +public enum EFileSystemParameter + +``` + +## Fields + + +### FileVerifyLevel + + +初始化的时候缓存文件校验级别 [YooAsset.EFileVerifyLevel](/docs/api/YooAsset/EFileVerifyLevel) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/EFileSystemParameter.cs#L12) + +Declaration +```csharp +FileVerifyLevel = 0 + +``` + +### FileVerifyMaxConcurrency + + +初始化的时候缓存文件校验最大并发数 ``System.Int32`` + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/EFileSystemParameter.cs#L17) + +Declaration +```csharp +FileVerifyMaxConcurrency = 1 + +``` + +### InstallCleanupMode + + +覆盖安装缓存清理模式 [YooAsset.EInstallCleanupMode](/docs/api/YooAsset/EInstallCleanupMode) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/EFileSystemParameter.cs#L22) + +Declaration +```csharp +InstallCleanupMode = 2 + +``` + +### DisableUnityWebCache + + +禁用Unity的网络缓存 ``System.Boolean`` + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/EFileSystemParameter.cs#L27) + +Declaration +```csharp +DisableUnityWebCache = 3 + +``` + +### UnityWebRequestCreator + + +UnityWebRequest 创建委托 [YooAsset.EFileSystemParameter.UnityWebRequestCreator](/docs/api/YooAsset/EFileSystemParameter#unitywebrequestcreator) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/EFileSystemParameter.cs#L32) + +Declaration +```csharp +UnityWebRequestCreator = 4 + +``` + +### DownloadDisableOndemand + + +禁用边玩边下机制 ``System.Boolean`` + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/EFileSystemParameter.cs#L37) + +Declaration +```csharp +DownloadDisableOndemand = 5 + +``` + +### DownloadBackend + + +下载后台接口 ``YooAsset.IDownloadBackend`` + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/EFileSystemParameter.cs#L42) + +Declaration +```csharp +DownloadBackend = 6 + +``` + +### DownloadMaxConcurrency + + +最大并发连接数 默认值:10(推荐范围 1-32) ``System.Int32`` + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/EFileSystemParameter.cs#L47) + +Declaration +```csharp +DownloadMaxConcurrency = 7 + +``` + +### DownloadMaxRequestPerFrame + + +每帧发起的最大请求数 默认值:5(推荐范围 1-10)``System.Int32`` + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/EFileSystemParameter.cs#L52) + +Declaration +```csharp +DownloadMaxRequestPerFrame = 8 + +``` + +### DownloadWatchdogTimeout + + +下载任务的看门狗机制超时时间 ``System.Int32`` + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/EFileSystemParameter.cs#L57) + +Declaration +```csharp +DownloadWatchdogTimeout = 9 + +``` + +### DownloadResumeMinimumSize + + +启用断点续传的最小尺寸 ``System.Int64`` + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/EFileSystemParameter.cs#L62) + +Declaration +```csharp +DownloadResumeMinimumSize = 10 + +``` + +### VirtualWebglMode + + +模拟WebGL平台模式 ``System.Boolean`` + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/EFileSystemParameter.cs#L67) + +Declaration +```csharp +VirtualWebglMode = 11 + +``` + +### VirtualDownloadMode + + +模拟虚拟下载模式 ``System.Boolean`` + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/EFileSystemParameter.cs#L72) + +Declaration +```csharp +VirtualDownloadMode = 12 + +``` + +### VirtualDownloadSpeed + + +模拟虚拟下载的网速(单位:字节) ``System.Int32`` + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/EFileSystemParameter.cs#L77) + +Declaration +```csharp +VirtualDownloadSpeed = 13 + +``` + +### AsyncSimulateMinFrame + + +异步模拟加载最小帧数 ``System.Int32`` + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/EFileSystemParameter.cs#L82) + +Declaration +```csharp +AsyncSimulateMinFrame = 14 + +``` + +### AsyncSimulateMaxFrame + + +异步模拟加载最大帧数 ``System.Int32`` + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/EFileSystemParameter.cs#L87) + +Declaration +```csharp +AsyncSimulateMaxFrame = 15 + +``` + +### CopyBuiltinPackageManifest + + +拷贝内置清单 ``System.Boolean`` + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/EFileSystemParameter.cs#L92) + +Declaration +```csharp +CopyBuiltinPackageManifest = 16 + +``` + +### CopyBuiltinPackageManifestDestRoot + + +拷贝内置清单的目标目录 ``System.String`` + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/EFileSystemParameter.cs#L97) + +Declaration +```csharp +CopyBuiltinPackageManifestDestRoot = 17 + +``` + +### UnpackFileSystemRoot + + +解压文件系统的根目录 ``System.String`` + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/EFileSystemParameter.cs#L102) + +Declaration +```csharp +UnpackFileSystemRoot = 18 + +``` + +### RemoteService + + +远端资源地址查询服务类 [YooAsset.IRemoteService](/docs/api/YooAsset/IRemoteService) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/EFileSystemParameter.cs#L107) + +Declaration +```csharp +RemoteService = 19 + +``` + +### AssetBundleDecryptor + + +AssetBundle 解密器 [YooAsset.IBundleDecryptor](/docs/api/YooAsset/IBundleDecryptor) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/EFileSystemParameter.cs#L112) + +Declaration +```csharp +AssetBundleDecryptor = 20 + +``` + +### RawBundleDecryptor + + +RawBundle 解密器 [YooAsset.IBundleDecryptor](/docs/api/YooAsset/IBundleDecryptor) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/EFileSystemParameter.cs#L117) + +Declaration +```csharp +RawBundleDecryptor = 21 + +``` + +### ArchiveBundleDecryptor + + +ArchiveBundle 解密器 [YooAsset.IBundleDecryptor](/docs/api/YooAsset/IBundleDecryptor) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/EFileSystemParameter.cs#L122) + +Declaration +```csharp +ArchiveBundleDecryptor = 22 + +``` + +### AssetBundleFallbackDecryptor + + +AssetBundle 备用解密器 [YooAsset.IBundleMemoryDecryptor](/docs/api/YooAsset/IBundleMemoryDecryptor) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/EFileSystemParameter.cs#L127) + +Declaration +```csharp +AssetBundleFallbackDecryptor = 23 + +``` + +### ManifestDecryptor + + +资源清单解密器 [YooAsset.IManifestDecryptor](/docs/api/YooAsset/IManifestDecryptor) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/EFileSystemParameter.cs#L132) + +Declaration +```csharp +ManifestDecryptor = 24 + +``` + +### DownloadRetryPolicy + + +下载重试判定策略 [YooAsset.IDownloadRetryPolicy](/docs/api/YooAsset/IDownloadRetryPolicy) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/EFileSystemParameter.cs#L137) + +Declaration +```csharp +DownloadRetryPolicy = 25 + +``` + +### DownloadUrlPolicy + + +URL 选择策略 [YooAsset.IDownloadUrlPolicy](/docs/api/YooAsset/IDownloadUrlPolicy) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/EFileSystemParameter.cs#L142) + +Declaration +```csharp +DownloadUrlPolicy = 26 + +``` + +### WebPlatformStrategy + + +WebGL 平台策略 ``YooAsset.IWebPlatformStrategy`` + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/EFileSystemParameter.cs#L147) + +Declaration +```csharp +WebPlatformStrategy = 27 + +``` + +### BundleUnpackPolicy + + +内置资源包解包策略 [YooAsset.IBundleUnpackPolicy](/docs/api/YooAsset/IBundleUnpackPolicy) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/EFileSystemParameter.cs#L152) + +Declaration +```csharp +BundleUnpackPolicy = 28 + +``` + +### BuiltinFileAccessor + + +内置文件访问器 [YooAsset.IBuiltinFileAccessor](/docs/api/YooAsset/IBuiltinFileAccessor) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/EFileSystemParameter.cs#L157) + +Declaration +```csharp +BuiltinFileAccessor = 29 + +``` +--- + +# Enum EFileVerifyLevel + + +文件校验等级 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/BundleCache/Services/SandboxBundleCache/EFileVerifyLevel.cs#L7) + +Declaration +```csharp +public enum EFileVerifyLevel + +``` + +## Fields + + +### Low + + +验证文件存在 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/BundleCache/Services/SandboxBundleCache/EFileVerifyLevel.cs#L12) + +Declaration +```csharp +Low = 1 + +``` + +### Middle + + +验证文件大小 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/BundleCache/Services/SandboxBundleCache/EFileVerifyLevel.cs#L17) + +Declaration +```csharp +Middle = 2 + +``` + +### High + + +验证文件CRC + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/BundleCache/Services/SandboxBundleCache/EFileVerifyLevel.cs#L22) + +Declaration +```csharp +High = 3 + +``` +--- + +# Enum EInstallCleanupMode + + +覆盖安装清理模式 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/Services/SandboxFileSystem/EInstallCleanupMode.cs#L7) + +Declaration +```csharp +public enum EInstallCleanupMode + +``` + +## Fields + + +### None + + +不做任何处理 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/Services/SandboxFileSystem/EInstallCleanupMode.cs#L12) + +Declaration +```csharp +None = 0 + +``` + +### ClearAllCacheFiles + + +清理所有缓存文件(包含资源文件和清单文件) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/Services/SandboxFileSystem/EInstallCleanupMode.cs#L17) + +Declaration +```csharp +ClearAllCacheFiles = 1 + +``` + +### ClearAllBundleFiles + + +清理所有缓存的资源文件 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/Services/SandboxFileSystem/EInstallCleanupMode.cs#L22) + +Declaration +```csharp +ClearAllBundleFiles = 2 + +``` + +### ClearAllManifestFiles + + +清理所有缓存的清单文件 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/Services/SandboxFileSystem/EInstallCleanupMode.cs#L27) + +Declaration +```csharp +ClearAllManifestFiles = 3 + +``` +--- + +# Class EnsureBundleFileOperation + + +确保资源包已就绪的异步操作 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/EnsureBundleFileOperation.cs#L7) + +Declaration +```csharp +public sealed class EnsureBundleFileOperation : AsyncOperationBase, IEnumerator, IComparable + +``` + +## Properties + + +### Detail + + +资源包文件详情 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/EnsureBundleFileOperation.cs#L60) + +Declaration +```csharp +public EnsureBundleFileOperation.BundleDetail Detail { get; } + +``` + +## Methods + + +### InternalStart() + + +内部启动方法(子类必须实现) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/EnsureBundleFileOperation.cs#L68) + +Declaration +```csharp +protected override void InternalStart() + +``` + +### InternalUpdate() + + +内部更新方法(子类必须实现) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/EnsureBundleFileOperation.cs#L72) + +Declaration +```csharp +protected override void InternalUpdate() + +``` + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IComparable`` +--- + +# Struct EnsureBundleFileOperation.BundleDetail + + +资源包文件详情 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/EnsureBundleFileOperation.cs#L12) + +Declaration +```csharp +public readonly struct EnsureBundleFileOperation.BundleDetail + +``` + +## Fields + + +### BundleName + + +资源包名称 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/EnsureBundleFileOperation.cs#L17) + +Declaration +```csharp +public readonly string BundleName + +``` + +### BundleFilePath + + +资源包文件的本地路径 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/EnsureBundleFileOperation.cs#L22) + +Declaration +```csharp +public readonly string BundleFilePath + +``` + +### BundleType + + +资源包类型 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/EnsureBundleFileOperation.cs#L27) + +Declaration +```csharp +public readonly int BundleType + +``` + +### IsEncrypted + + +文件是否加密 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/EnsureBundleFileOperation.cs#L32) + +Declaration +```csharp +public readonly bool IsEncrypted + +``` +--- + +# Struct EnsureBundleFileOptions + + +确保资源包文件已就绪的操作选项 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/EnsureBundleFileOptions.cs#L7) + +Declaration +```csharp +public readonly struct EnsureBundleFileOptions + +``` + +## Properties + + +### Location + + +资源定位地址 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/EnsureBundleFileOptions.cs#L12) + +Declaration +```csharp +public string Location { get; } + +``` + +### AssetInfo + + +资源信息 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/EnsureBundleFileOptions.cs#L17) + +Declaration +```csharp +public AssetInfo AssetInfo { get; } + +``` +--- + +# Enum EOperationStatus + + +异步操作状态枚举 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/AsyncOperation/EOperationStatus.cs#L7) + +Declaration +```csharp +public enum EOperationStatus + +``` + +## Fields + + +### None + + +未开始 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/AsyncOperation/EOperationStatus.cs#L12) + +Declaration +```csharp +None = 0 + +``` + +### Processing + + +处理中 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/AsyncOperation/EOperationStatus.cs#L17) + +Declaration +```csharp +Processing = 1 + +``` + +### Succeeded + + +已成功 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/AsyncOperation/EOperationStatus.cs#L22) + +Declaration +```csharp +Succeeded = 2 + +``` + +### Failed + + +已失败 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/AsyncOperation/EOperationStatus.cs#L27) + +Declaration +```csharp +Failed = 3 + +``` +--- + +# Enum EPlayMode + + +运行模式 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/EPlayMode.cs#L7) + +Declaration +```csharp +public enum EPlayMode + +``` + +## Fields + + +### None + + +未指定运行模式 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/EPlayMode.cs#L12) + +Declaration +```csharp +None = 0 + +``` + +### EditorSimulateMode + + +编辑器下的模拟模式 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/EPlayMode.cs#L17) + +Declaration +```csharp +EditorSimulateMode = 1 + +``` + +### OfflinePlayMode + + +离线运行模式 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/EPlayMode.cs#L22) + +Declaration +```csharp +OfflinePlayMode = 2 + +``` + +### HostPlayMode + + +联机运行模式 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/EPlayMode.cs#L27) + +Declaration +```csharp +HostPlayMode = 3 + +``` + +### WebPlayMode + + +WebGL运行模式 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/EPlayMode.cs#L32) + +Declaration +```csharp +WebPlayMode = 4 + +``` + +### CustomPlayMode + + +自定义运行模式 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/EPlayMode.cs#L37) + +Declaration +```csharp +CustomPlayMode = 5 + +``` +--- + +# Class FileSystemParameters + + +提供文件系统的创建参数与工厂方法 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/FileSystemParameters.cs#L9) + +Declaration +```csharp +public class FileSystemParameters + +``` + +## Properties + + +### FileSystemTypeName + + +文件系统的完整类型名称 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/FileSystemParameters.cs#L19) + +Declaration +```csharp +public string FileSystemTypeName { get; } + +``` + +### PackageRoot + + +文件系统的根目录 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/FileSystemParameters.cs#L24) + +Declaration +```csharp +public string PackageRoot { get; } + +``` + +## Methods + + +### AddParameter(string, object) + + +添加自定义参数 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/FileSystemParameters.cs#L42) + +Declaration +```csharp +public void AddParameter(string paramName, object value) + +``` + +##### Parameters + +TypeNameDescription``System.String``*paramName*参数名称``System.Object``*value*参数值 + +### AddParameter(Enum, object) + + +添加自定义参数 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/FileSystemParameters.cs#L52) + +Declaration +```csharp +public void AddParameter(Enum paramType, object value) + +``` + +##### Parameters + +TypeNameDescription``System.Enum``*paramType*参数类型``System.Object``*value*参数值 + +### CreateDefaultEditorFileSystemParameters(string) + + +创建默认的编辑器文件系统参数 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/FileSystemParameters.cs#L93) + +Declaration +```csharp +public static FileSystemParameters CreateDefaultEditorFileSystemParameters(string packageRoot) + +``` + +##### Returns + + +[YooAsset.FileSystemParameters](/docs/api/YooAsset/FileSystemParameters): 配置好的文件系统参数实例 + + +##### Parameters + +TypeNameDescription``System.String``*packageRoot*文件系统的根目录 + +### CreateDefaultBuiltinFileSystemParameters(string) + + +创建默认的内置文件系统参数 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/FileSystemParameters.cs#L105) + +Declaration +```csharp +public static FileSystemParameters CreateDefaultBuiltinFileSystemParameters(string packageRoot) + +``` + +##### Returns + + +[YooAsset.FileSystemParameters](/docs/api/YooAsset/FileSystemParameters): 配置好的文件系统参数实例 + + +##### Parameters + +TypeNameDescription``System.String``*packageRoot*文件系统的根目录 + +### CreateDefaultBuiltinFileSystemParameters() + + +创建默认的内置文件系统参数 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/FileSystemParameters.cs#L116) + +Declaration +```csharp +public static FileSystemParameters CreateDefaultBuiltinFileSystemParameters() + +``` + +##### Returns + + +[YooAsset.FileSystemParameters](/docs/api/YooAsset/FileSystemParameters): 配置好的文件系统参数实例### CreateDefaultSandboxFileSystemParameters(IRemoteService, string) +创建默认的沙盒文件系统参数 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/FileSystemParameters.cs#L129) + +Declaration +```csharp +public static FileSystemParameters CreateDefaultSandboxFileSystemParameters(IRemoteService remoteService, string packageRoot) + +``` + +##### Returns + + +[YooAsset.FileSystemParameters](/docs/api/YooAsset/FileSystemParameters): 配置好的文件系统参数实例 + + +##### Parameters + +TypeNameDescription[YooAsset.IRemoteService](/docs/api/YooAsset/IRemoteService)*remoteService*远端资源地址查询服务类``System.String``*packageRoot*文件系统的根目录 + +### CreateDefaultSandboxFileSystemParameters(IRemoteService) + + +创建默认的沙盒文件系统参数 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/FileSystemParameters.cs#L142) + +Declaration +```csharp +public static FileSystemParameters CreateDefaultSandboxFileSystemParameters(IRemoteService remoteService) + +``` + +##### Returns + + +[YooAsset.FileSystemParameters](/docs/api/YooAsset/FileSystemParameters): 配置好的文件系统参数实例 + + +##### Parameters + +TypeNameDescription[YooAsset.IRemoteService](/docs/api/YooAsset/IRemoteService)*remoteService*远端资源地址查询服务类 + +### CreateDefaultWebServerFileSystemParameters(bool) + + +创建默认的WebGL 服务器文件系统参数 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/FileSystemParameters.cs#L155) + +Declaration +```csharp +public static FileSystemParameters CreateDefaultWebServerFileSystemParameters(bool disableUnityWebCache) + +``` + +##### Returns + + +[YooAsset.FileSystemParameters](/docs/api/YooAsset/FileSystemParameters): 配置好的文件系统参数实例 + + +##### Parameters + +TypeNameDescription``System.Boolean``*disableUnityWebCache*禁用Unity的网络缓存 + +### CreateDefaultWebServerFileSystemParameters() + + +创建默认的WebGL 服务器文件系统参数 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/FileSystemParameters.cs#L167) + +Declaration +```csharp +public static FileSystemParameters CreateDefaultWebServerFileSystemParameters() + +``` + +##### Returns + + +[YooAsset.FileSystemParameters](/docs/api/YooAsset/FileSystemParameters): 配置好的文件系统参数实例### CreateDefaultWebNetworkFileSystemParameters(IRemoteService, bool) +创建默认的 WebGL 网络文件系统参数 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/FileSystemParameters.cs#L181) + +Declaration +```csharp +public static FileSystemParameters CreateDefaultWebNetworkFileSystemParameters(IRemoteService remoteService, bool disableUnityWebCache) + +``` + +##### Returns + + +[YooAsset.FileSystemParameters](/docs/api/YooAsset/FileSystemParameters): 配置好的文件系统参数实例 + + +##### Parameters + +TypeNameDescription[YooAsset.IRemoteService](/docs/api/YooAsset/IRemoteService)*remoteService*远端资源地址查询服务类``System.Boolean``*disableUnityWebCache*禁用Unity的网络缓存 + +### CreateDefaultWebNetworkFileSystemParameters(IRemoteService) + + +创建默认的 WebGL 网络文件系统参数 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/FileSystem/FileSystemParameters.cs#L195) + +Declaration +```csharp +public static FileSystemParameters CreateDefaultWebNetworkFileSystemParameters(IRemoteService remoteService) + +``` + +##### Returns + + +[YooAsset.FileSystemParameters](/docs/api/YooAsset/FileSystemParameters): 配置好的文件系统参数实例 + + +##### Parameters + +TypeNameDescription[YooAsset.IRemoteService](/docs/api/YooAsset/IRemoteService)*remoteService*远端资源地址查询服务类 +--- + +# Class HandleBase + + +资源句柄基类,提供资源加载状态查询和释放功能。 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Handles/HandleBase.cs#L9) + +Declaration +```csharp +public abstract class HandleBase : IEnumerator, IDisposable + +``` + +## Properties + + +### Status + + +当前状态 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Handles/HandleBase.cs#L59) + +Declaration +```csharp +public EOperationStatus Status { get; } + +``` + +### Error + + +错误信息 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Handles/HandleBase.cs#L72) + +Declaration +```csharp +public string Error { get; } + +``` + +### Progress + + +加载进度 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Handles/HandleBase.cs#L85) + +Declaration +```csharp +public float Progress { get; } + +``` + +### IsDone + + +是否加载完毕 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Handles/HandleBase.cs#L98) + +Declaration +```csharp +public bool IsDone { get; } + +``` + +### IsValid + + +句柄是否有效 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Handles/HandleBase.cs#L111) + +Declaration +```csharp +public bool IsValid { get; } + +``` + +## Methods + + +### Release() + + +释放资源句柄 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Handles/HandleBase.cs#L28) + +Declaration +```csharp +public void Release() + +``` + +### Dispose() + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Handles/HandleBase.cs#L42) + +Declaration +```csharp +public void Dispose() + +``` + +### GetAssetInfo() + + +获取资源信息 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Handles/HandleBase.cs#L51) + +Declaration +```csharp +public AssetInfo GetAssetInfo() + +``` + +##### Returns + + +[YooAsset.AssetInfo](/docs/api/YooAsset/AssetInfo): 资源信息### GetAwaiter() +获取用于 async/await 的 Awaiter + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Handles/HandleBase.cs#L146) + +Declaration +```csharp +public OperationAwaiter GetAwaiter() + +``` + +##### Returns + + +[YooAsset.OperationAwaiter](/docs/api/YooAsset/OperationAwaiter): 用于 async/await 的 Awaiter 对象 + + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IDisposable`` +--- + +# Class HashUtility + + +哈希工具类 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Utility/Utilities/HashUtility.cs#L11) + +Declaration +```csharp +public static class HashUtility + +``` + +## Methods + + +### ComputeMD5(string) + + +计算字符串的MD5哈希值 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Utility/Utilities/HashUtility.cs#L33) + +Declaration +```csharp +public static string ComputeMD5(string value) + +``` + +##### Returns + + +``System.String`` + + +##### Parameters + +TypeName``System.String``*value* + +### ComputeFileMD5(string) + + +计算文件的MD5哈希值 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Utility/Utilities/HashUtility.cs#L45) + +Declaration +```csharp +public static string ComputeFileMD5(string filePath) + +``` + +##### Returns + + +``System.String`` + + +##### Parameters + +TypeName``System.String``*filePath* + +### ComputeMD5(Stream) + + +计算数据流的MD5哈希值 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Utility/Utilities/HashUtility.cs#L59) + +Declaration +```csharp +public static string ComputeMD5(Stream stream) + +``` + +##### Returns + + +``System.String`` + + +##### Parameters + +TypeName``System.IO.Stream``*stream* + +### ComputeMD5(byte[]) + + +计算字节数组的MD5哈希值 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Utility/Utilities/HashUtility.cs#L74) + +Declaration +```csharp +public static string ComputeMD5(byte[] buffer) + +``` + +##### Returns + + +``System.String`` + + +##### Parameters + +TypeName``System.Byte[]``*buffer* + +### ComputeCrc32(string) + + +计算字符串的CRC32哈希值 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Utility/Utilities/HashUtility.cs#L91) + +Declaration +```csharp +public static string ComputeCrc32(string value) + +``` + +##### Returns + + +``System.String`` + + +##### Parameters + +TypeName``System.String``*value* + +### ComputeCrc32AsUInt(string) + + +计算字符串的CRC32值(返回无符号整数) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Utility/Utilities/HashUtility.cs#L103) + +Declaration +```csharp +public static uint ComputeCrc32AsUInt(string value) + +``` + +##### Returns + + +``System.UInt32`` + + +##### Parameters + +TypeName``System.String``*value* + +### ComputeFileCrc32(string) + + +计算文件的CRC32哈希值 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Utility/Utilities/HashUtility.cs#L115) + +Declaration +```csharp +public static string ComputeFileCrc32(string filePath) + +``` + +##### Returns + + +``System.String`` + + +##### Parameters + +TypeName``System.String``*filePath* + +### ComputeFileCrc32AsUInt(string) + + +计算文件的CRC32值(返回无符号整数) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Utility/Utilities/HashUtility.cs#L129) + +Declaration +```csharp +public static uint ComputeFileCrc32AsUInt(string filePath) + +``` + +##### Returns + + +``System.UInt32`` + + +##### Parameters + +TypeName``System.String``*filePath* + +### ComputeCrc32(Stream) + + +计算数据流的CRC32哈希值 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Utility/Utilities/HashUtility.cs#L143) + +Declaration +```csharp +public static string ComputeCrc32(Stream stream) + +``` + +##### Returns + + +``System.String`` + + +##### Parameters + +TypeName``System.IO.Stream``*stream* + +### ComputeCrc32AsUInt(Stream) + + +计算数据流的CRC32值(返回无符号整数) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Utility/Utilities/HashUtility.cs#L158) + +Declaration +```csharp +public static uint ComputeCrc32AsUInt(Stream stream) + +``` + +##### Returns + + +``System.UInt32`` + + +##### Parameters + +TypeName``System.IO.Stream``*stream* + +### ComputeCrc32(byte[]) + + +计算字节数组的CRC32哈希值 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Utility/Utilities/HashUtility.cs#L173) + +Declaration +```csharp +public static string ComputeCrc32(byte[] buffer) + +``` + +##### Returns + + +``System.String`` + + +##### Parameters + +TypeName``System.Byte[]``*buffer* + +### ComputeCrc32AsUInt(byte[]) + + +计算字节数组的CRC32值(返回无符号整数) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Utility/Utilities/HashUtility.cs#L188) + +Declaration +```csharp +public static uint ComputeCrc32AsUInt(byte[] buffer) + +``` + +##### Returns + + +``System.UInt32`` + + +##### Parameters + +TypeName``System.Byte[]``*buffer* +--- + +# Class HostPlayModeOptions + + +联机运行模式的操作选项 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/InitializePackageOptions.cs#L51) + +Declaration +```csharp +public class HostPlayModeOptions : InitializePackageOptions + +``` + +## Properties + + +### BuiltinFileSystemParameters + + +内置文件系统初始化参数 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/InitializePackageOptions.cs#L56) + +Declaration +```csharp +public FileSystemParameters BuiltinFileSystemParameters { get; set; } + +``` + +### CacheFileSystemParameters + + +缓存文件系统初始化参数 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/InitializePackageOptions.cs#L61) + +Declaration +```csharp +public FileSystemParameters CacheFileSystemParameters { get; set; } + +``` +--- + +# Interface IBuiltinFileAccessor + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IBuiltinFileAccessor.cs#L10) + +Declaration +```csharp +public interface IBuiltinFileAccessor + +``` + +## Methods + + +### FileExists(string) + + +检查内置文件是否存在 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IBuiltinFileAccessor.cs#L16) + +Declaration +```csharp +bool FileExists(string filePath) + +``` + +##### Returns + + +``System.Boolean`` + + +##### Parameters + +TypeNameDescription``System.String``*filePath*内置文件路径 + +### ReadAllBytes(string) + + +读取内置文件的所有字节 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IBuiltinFileAccessor.cs#L22) + +Declaration +```csharp +byte[] ReadAllBytes(string filePath) + +``` + +##### Returns + + +``System.Byte[]`` + + +##### Parameters + +TypeNameDescription``System.String``*filePath*内置文件路径 +--- + +# Interface IBundleDecryptor + + +资源包解密器的基接口,本身不包含成员。 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IBundleDecryptor.cs#L52) + +Declaration +```csharp +public interface IBundleDecryptor + +``` +--- + +# Interface IBundleEncryptor + + +定义资源包的加密行为 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IBundleEncryptor.cs#L61) + +Declaration +```csharp +public interface IBundleEncryptor + +``` + +## Methods + + +### Encrypt(BundleEncryptArgs) + + +对指定的资源包文件执行加密 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IBundleEncryptor.cs#L68) + +Declaration +```csharp +BundleEncryptResult Encrypt(BundleEncryptArgs args) + +``` + +##### Returns + + +[YooAsset.BundleEncryptResult](/docs/api/YooAsset/BundleEncryptResult): 包含加密状态和加密后数据的结果 + + +##### Parameters + +TypeNameDescription[YooAsset.BundleEncryptArgs](/docs/api/YooAsset/BundleEncryptArgs)*args*加密操作的输入参数 +--- + +# Interface IBundleMemoryDecryptor + + +基于内存的资源包解密器。 +将整个加密数据解密为字节数组后加载。 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IBundleDecryptor.cs#L74) + +Declaration +```csharp +public interface IBundleMemoryDecryptor : IBundleDecryptor + +``` + +## Methods + + +### GetDecryptedData(BundleDecryptArgs) + + +将资源包数据解密并返回解密后的字节数组 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IBundleDecryptor.cs#L81) + +Declaration +```csharp +byte[] GetDecryptedData(BundleDecryptArgs args) + +``` + +##### Returns + + +``System.Byte[]``: 解密后的资源包数据 + + +##### Parameters + +TypeNameDescription[YooAsset.BundleDecryptArgs](/docs/api/YooAsset/BundleDecryptArgs)*args*解密操作的输入参数 +--- + +# Interface IBundleOffsetDecryptor + + +基于偏移量的资源包解密器。 +用于跳过文件头部加密区域后直接加载 AssetBundle。 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IBundleDecryptor.cs#L60) + +Declaration +```csharp +public interface IBundleOffsetDecryptor : IBundleDecryptor + +``` + +## Methods + + +### GetFileOffset(BundleDecryptArgs) + + +获取解密数据的起始偏移量(字节) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IBundleDecryptor.cs#L67) + +Declaration +```csharp +long GetFileOffset(BundleDecryptArgs args) + +``` + +##### Returns + + +``System.Int64``: AssetBundle 有效数据在文件中的起始偏移量 + + +##### Parameters + +TypeNameDescription[YooAsset.BundleDecryptArgs](/docs/api/YooAsset/BundleDecryptArgs)*args*解密操作的输入参数 +--- + +# Interface IBundleStreamDecryptor + + +基于流的资源包解密器。 +通过提供解密流实现流式加载,适用于大文件场景。 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IBundleDecryptor.cs#L88) + +Declaration +```csharp +public interface IBundleStreamDecryptor : IBundleDecryptor + +``` + +## Methods + + +### GetBufferSize(BundleDecryptArgs) + + +获取流式读取时使用的缓冲区大小(字节) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IBundleDecryptor.cs#L95) + +Declaration +```csharp +int GetBufferSize(BundleDecryptArgs args) + +``` + +##### Returns + + +``System.Int32``: 建议的缓冲区字节数 + + +##### Parameters + +TypeNameDescription[YooAsset.BundleDecryptArgs](/docs/api/YooAsset/BundleDecryptArgs)*args*解密操作的输入参数 + +### CreateDecryptionStream(BundleDecryptArgs) + + +创建用于解密读取的流实例 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IBundleDecryptor.cs#L105) + +Declaration +```csharp +Stream CreateDecryptionStream(BundleDecryptArgs args) + +``` + +##### Returns + + +``System.IO.Stream``: 可供 AssetBundle 加载使用的解密流 + + +##### Parameters + +TypeNameDescription[YooAsset.BundleDecryptArgs](/docs/api/YooAsset/BundleDecryptArgs)*args*解密操作的输入参数 +--- + +# Interface IBundleUnpackPolicy + + +内置资源包解包策略接口 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IBundleUnpackPolicy.cs#L75) + +Declaration +```csharp +public interface IBundleUnpackPolicy + +``` + +## Methods + + +### IsUnpackBundle(BundleUnpackInfo) + + +判定指定资源包是否为需要解包的类型 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IBundleUnpackPolicy.cs#L80) + +Declaration +```csharp +bool IsUnpackBundle(BundleUnpackInfo unpackInfo) + +``` + +##### Returns + + +``System.Boolean`` + + +##### Parameters + +TypeName[YooAsset.BundleUnpackInfo](/docs/api/YooAsset/BundleUnpackInfo)*unpackInfo* +--- + +# Interface IDownloadRetryPolicy + + +下载重试策略 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IDownloadRetryPolicy.cs#L7) + +Declaration +```csharp +public interface IDownloadRetryPolicy + +``` + +## Methods + + +### IsRetryableError(string, long, string) + + +判断本次下载失败是否属于可重试的错误 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IDownloadRetryPolicy.cs#L16) + +Declaration +```csharp +bool IsRetryableError(string url, long httpCode, string httpError) + +``` + +##### Returns + + +``System.Boolean``: true 允许重试;false 应立即失败。 + + +##### Parameters + +TypeNameDescription``System.String``*url*请求地址``System.Int64``*httpCode*HTTP 状态码(0 表示网络中断或非 HTTP 错误)``System.String``*httpError*服务器返回的错误描述文本 + +### CalculateRetryDelay(int, float) + + +计算本次重试应等待的时长(秒) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IDownloadRetryPolicy.cs#L24) + +Declaration +```csharp +float CalculateRetryDelay(int retryCount, float previousDelay) + +``` + +##### Returns + + +``System.Single``: 本次应等待的秒数 + + +##### Parameters + +TypeNameDescription``System.Int32``*retryCount*即将进入的重试次数(从 1 开始)``System.Single``*previousDelay*上一次等待时长(首次时为 0) +--- + +# Interface IDownloadUrlPolicy + + +URL 选择策略 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IDownloadUrlPolicy.cs#L8) + +Declaration +```csharp +public interface IDownloadUrlPolicy + +``` + +## Methods + + +### SelectUrl(IReadOnlyList) + + +选择本次请求应使用的 URL + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IDownloadUrlPolicy.cs#L15) + +Declaration +```csharp +string SelectUrl(IReadOnlyList candidateUrls) + +``` + +##### Returns + + +``System.String``: 选中的 URL + + +##### Parameters + +TypeNameDescription``System.Collections.Generic.IReadOnlyList``*candidateUrls*候选 URL 列表(至少包含一个) + +### OnRequestSucceeded(string) + + +反馈请求成功,策略可据此更新内部状态。 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IDownloadUrlPolicy.cs#L21) + +Declaration +```csharp +void OnRequestSucceeded(string url) + +``` + +##### Parameters + +TypeNameDescription``System.String``*url*实际使用的 URL + +### OnRequestFailed(string, long, string) + + +反馈请求失败,策略可据此更新内部状态。 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IDownloadUrlPolicy.cs#L29) + +Declaration +```csharp +void OnRequestFailed(string url, long httpCode, string httpError) + +``` + +##### Parameters + +TypeNameDescription``System.String``*url*实际使用的 URL``System.Int64``*httpCode*HTTP 状态码(0 表示网络中断或非 HTTP 错误)``System.String``*httpError*服务器返回的错误描述文本 +--- + +# Interface ILogger + + +自定义日志处理接口 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Utility/YooLogger.cs#L8) + +Declaration +```csharp +public interface ILogger + +``` + +## Methods + + +### Log(string) + + +输出普通日志 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Utility/YooLogger.cs#L13) + +Declaration +```csharp +void Log(string message) + +``` + +##### Parameters + +TypeName``System.String``*message* + +### LogWarning(string) + + +输出警告日志 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Utility/YooLogger.cs#L18) + +Declaration +```csharp +void LogWarning(string message) + +``` + +##### Parameters + +TypeName``System.String``*message* + +### LogError(string) + + +输出错误日志 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Utility/YooLogger.cs#L23) + +Declaration +```csharp +void LogError(string message) + +``` + +##### Parameters + +TypeName``System.String``*message* + +### LogException(Exception) + + +输出异常日志 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Utility/YooLogger.cs#L28) + +Declaration +```csharp +void LogException(Exception exception) + +``` + +##### Parameters + +TypeName``System.Exception``*exception* +--- + +# Interface IManifestDecryptor + + +资源清单解密器 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IManifestDecryptor.cs#L7) + +Declaration +```csharp +public interface IManifestDecryptor + +``` + +## Methods + + +### Decrypt(byte[]) + + +对加密的资源清单数据执行解密 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IManifestDecryptor.cs#L14) + +Declaration +```csharp +byte[] Decrypt(byte[] fileData) + +``` + +##### Returns + + +``System.Byte[]``: 解密后的字节数组 + + +##### Parameters + +TypeNameDescription``System.Byte[]``*fileData*已加密的清单数据 +--- + +# Interface IManifestEncryptor + + +资源清单加密器 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IManifestEncryptor.cs#L7) + +Declaration +```csharp +public interface IManifestEncryptor + +``` + +## Methods + + +### Encrypt(byte[]) + + +对资源清单的原始数据执行加密 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IManifestEncryptor.cs#L14) + +Declaration +```csharp +byte[] Encrypt(byte[] fileData) + +``` + +##### Returns + + +``System.Byte[]``: 加密后的字节数组 + + +##### Parameters + +TypeNameDescription``System.Byte[]``*fileData*待加密的清单数据 +--- + +# Struct ImportBundleInfo + + +导入的资源包信息 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderOptions.cs#L218) + +Declaration +```csharp +public readonly struct ImportBundleInfo + +``` + +## Properties + + +### FilePath + + +本地文件路径 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderOptions.cs#L223) + +Declaration +```csharp +public string FilePath { get; } + +``` + +### BundleName + + +资源包名称 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderOptions.cs#L228) + +Declaration +```csharp +public string BundleName { get; } + +``` + +### BundleGuid + + +资源包GUID + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderOptions.cs#L233) + +Declaration +```csharp +public string BundleGuid { get; } + +``` +--- + +# Class InitializeFileSystemOperation + + +初始化文件系统操作 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/Internal/InitializeFileSystemOperation.cs#L9) + +Declaration +```csharp +public sealed class InitializeFileSystemOperation : AsyncOperationBase, IEnumerator, IComparable + +``` + +## Methods + + +### InternalStart() + + +内部启动方法(子类必须实现) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/Internal/InitializeFileSystemOperation.cs#L32) + +Declaration +```csharp +protected override void InternalStart() + +``` + +### InternalUpdate() + + +内部更新方法(子类必须实现) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/Internal/InitializeFileSystemOperation.cs#L37) + +Declaration +```csharp +protected override void InternalUpdate() + +``` + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IComparable`` +--- + +# Class InitializePackageOperation + + +初始化资源包裹操作 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/InitializePackageOperation.cs#L8) + +Declaration +```csharp +public sealed class InitializePackageOperation : AsyncOperationBase, IEnumerator, IComparable + +``` + +## Methods + + +### InternalStart() + + +内部启动方法(子类必须实现) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/InitializePackageOperation.cs#L33) + +Declaration +```csharp +protected override void InternalStart() + +``` + +### InternalUpdate() + + +内部更新方法(子类必须实现) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/InitializePackageOperation.cs#L38) + +Declaration +```csharp +protected override void InternalUpdate() + +``` + +### InternalGetDescription() + + +获取操作的描述信息(子类可选实现) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/InitializePackageOperation.cs#L143) + +Declaration +```csharp +protected override string InternalGetDescription() + +``` + +##### Returns + + +``System.String``: 操作的描述字符串,默认返回空字符串。 + + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IComparable`` +--- + +# Class InitializePackageOptions + + +初始化资源包的操作选项 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/InitializePackageOptions.cs#L8) + +Declaration +```csharp +public abstract class InitializePackageOptions + +``` + +## Properties + + +### BundleLoadingMaxConcurrency + + +同时加载Bundle文件的最大并发数 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/InitializePackageOptions.cs#L13) + +Declaration +```csharp +public int BundleLoadingMaxConcurrency { get; set; } + +``` + +### AutoUnloadBundleWhenUnused + + +是否在资源引用计数为零时自动释放资源包 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/InitializePackageOptions.cs#L18) + +Declaration +```csharp +public bool AutoUnloadBundleWhenUnused { get; set; } + +``` + +### WebGLForceSyncLoadAsset + + +是否在WebGL平台强制同步加载资源对象 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/InitializePackageOptions.cs#L23) + +Declaration +```csharp +public bool WebGLForceSyncLoadAsset { get; set; } + +``` +--- + +# Class InstantiateOperation + + +游戏对象实例化操作 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Operations/InstantiateOperation.cs#L8) + +Declaration +```csharp +public sealed class InstantiateOperation : AsyncOperationBase, IEnumerator, IComparable + +``` + +## Properties + + +### Result + + +实例化的游戏对象 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Operations/InstantiateOperation.cs#L30) + +Declaration +```csharp +public GameObject Result { get; } + +``` + +## Methods + + +### InternalStart() + + +内部启动方法(子类必须实现) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Operations/InstantiateOperation.cs#L39) + +Declaration +```csharp +protected override void InternalStart() + +``` + +### InternalUpdate() + + +内部更新方法(子类必须实现) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Operations/InstantiateOperation.cs#L44) + +Declaration +```csharp +protected override void InternalUpdate() + +``` + +### InternalWaitForCompletion() + + +内部同步等待方法(子类可选实现) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Operations/InstantiateOperation.cs#L146) + +Declaration +```csharp +protected override void InternalWaitForCompletion() + +``` + +### InternalGetDescription() + + +获取操作的描述信息(子类可选实现) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Operations/InstantiateOperation.cs#L151) + +Declaration +```csharp +protected override string InternalGetDescription() + +``` + +##### Returns + + +``System.String``: 操作的描述字符串,默认返回空字符串。### Cancel() +取消实例化对象操作 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Operations/InstantiateOperation.cs#L160) + +Declaration +```csharp +public void Cancel() + +``` + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IComparable`` +--- + +# Struct InstantiateOptions + + +游戏对象实例化的操作选项 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Operations/InstantiateOptions.cs#L8) + +Declaration +```csharp +public readonly struct InstantiateOptions + +``` + +## Properties + + +### IsActive + + +是否激活实例化对象 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Operations/InstantiateOptions.cs#L13) + +Declaration +```csharp +public bool IsActive { get; } + +``` + +### Parent + + +将指定给新对象的父对象 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Operations/InstantiateOptions.cs#L18) + +Declaration +```csharp +public Transform Parent { get; } + +``` + +### InWorldSpace + + +是否在世界空间中定位新对象 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Operations/InstantiateOptions.cs#L26) + +Declaration +```csharp +public bool InWorldSpace { get; } + +``` + +### Position + + +新对象的位置 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Operations/InstantiateOptions.cs#L31) + +Declaration +```csharp +public Vector3 Position { get; } + +``` + +### Rotation + + +新对象的旋转 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Operations/InstantiateOptions.cs#L36) + +Declaration +```csharp +public Quaternion Rotation { get; } + +``` +--- + +# Interface IRemoteService + + +远端资源服务 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IRemoteService.cs#L8) + +Declaration +```csharp +public interface IRemoteService + +``` + +## Methods + + +### GetRemoteUrls(string) + + +获取指定文件的所有远端候选地址,按优先级排序。 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Interfaces/IRemoteService.cs#L15) + +Declaration +```csharp +IReadOnlyList GetRemoteUrls(string fileName) + +``` + +##### Returns + + +``System.Collections.Generic.IReadOnlyList``: 按优先级排序的远端候选地址列表,至少包含一个 URL。 + + +##### Parameters + +TypeNameDescription``System.String``*fileName*请求的文件名称 +--- + +# Class LoadPackageManifestOperation + + +加载资源清单操作 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/LoadPackageManifestOperation.cs#L7) + +Declaration +```csharp +public sealed class LoadPackageManifestOperation : AsyncOperationBase, IEnumerator, IComparable + +``` + +## Methods + + +### InternalStart() + + +内部启动方法(子类必须实现) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/LoadPackageManifestOperation.cs#L29) + +Declaration +```csharp +protected override void InternalStart() + +``` + +### InternalUpdate() + + +内部更新方法(子类必须实现) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/LoadPackageManifestOperation.cs#L34) + +Declaration +```csharp +protected override void InternalUpdate() + +``` + +### InternalGetDescription() + + +获取操作的描述信息(子类可选实现) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/LoadPackageManifestOperation.cs#L101) + +Declaration +```csharp +protected override string InternalGetDescription() + +``` + +##### Returns + + +``System.String``: 操作的描述字符串,默认返回空字符串。 + + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IComparable`` +--- + +# Struct LoadPackageManifestOptions + + +加载清单的操作选项 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/LoadPackageManifestOptions.cs#L7) + +Declaration +```csharp +public readonly struct LoadPackageManifestOptions + +``` + +## Properties + + +### PackageVersion + + +包裹版本 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/LoadPackageManifestOptions.cs#L12) + +Declaration +```csharp +public string PackageVersion { get; } + +``` + +### Timeout + + +超时时间 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/LoadPackageManifestOptions.cs#L17) + +Declaration +```csharp +public int Timeout { get; } + +``` +--- + +# Class OfflinePlayModeOptions + + +离线运行模式的操作选项 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/InitializePackageOptions.cs#L40) + +Declaration +```csharp +public class OfflinePlayModeOptions : InitializePackageOptions + +``` + +## Properties + + +### BuiltinFileSystemParameters + + +内置文件系统初始化参数 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/InitializePackageOptions.cs#L45) + +Declaration +```csharp +public FileSystemParameters BuiltinFileSystemParameters { get; set; } + +``` +--- + +# Struct OperationAwaiter + + +支持异步编程的自定义 Awaiter + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/AsyncOperation/OperationAwaiter.cs#L10) + +Declaration +```csharp +public readonly struct OperationAwaiter : ICriticalNotifyCompletion, INotifyCompletion + +``` + +## Properties + + +### IsCompleted + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/AsyncOperation/OperationAwaiter.cs#L24) + +Declaration +```csharp +public bool IsCompleted { get; } + +``` + +## Methods + + +### GetResult() + + +获取操作结果 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/AsyncOperation/OperationAwaiter.cs#L32) + +Declaration +```csharp +public void GetResult() + +``` + +### OnCompleted(Action) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/AsyncOperation/OperationAwaiter.cs#L37) + +Declaration +```csharp +public void OnCompleted(Action continuation) + +``` + +##### Parameters + +TypeName``System.Action``*continuation* + +### UnsafeOnCompleted(Action) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/AsyncOperation/OperationAwaiter.cs#L43) + +Declaration +```csharp +public void UnsafeOnCompleted(Action continuation) + +``` + +##### Parameters + +TypeName``System.Action``*continuation* + +## Implements + +- ``System.Runtime.CompilerServices.ICriticalNotifyCompletion`` + +- ``System.Runtime.CompilerServices.INotifyCompletion`` +--- + +# Class PackageBuildParameters + + +资源包裹构建的调用参数 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/PackageBuilder/PackageBuildParameters.cs#L8) + +Declaration +```csharp +public class PackageBuildParameters + +``` + +## Properties + + +### PackageName + + +包裹名称 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/PackageBuilder/PackageBuildParameters.cs#L13) + +Declaration +```csharp +public string PackageName { get; } + +``` + +### BuildPipelineName + + +构建管线名称 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/PackageBuilder/PackageBuildParameters.cs#L18) + +Declaration +```csharp +public string BuildPipelineName { get; set; } + +``` + +### BuildBundleType + + +构建资源包类型 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/PackageBuilder/PackageBuildParameters.cs#L23) + +Declaration +```csharp +public int BuildBundleType { get; set; } + +``` + +### UserData + + +用户自定义数据 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/PackageBuilder/PackageBuildParameters.cs#L31) + +Declaration +```csharp +public object UserData { get; set; } + +``` + +### AssemblyName + + +构建类所属的程序集名称 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/PackageBuilder/PackageBuildParameters.cs#L36) + +Declaration +```csharp +public string AssemblyName { get; set; } + +``` + +### TypeFullName + + +构建执行的类型全称 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/PackageBuilder/PackageBuildParameters.cs#L44) + +Declaration +```csharp +public string TypeFullName { get; set; } + +``` + +### MethodName + + +构建执行的方法名称 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/PackageBuilder/PackageBuildParameters.cs#L52) + +Declaration +```csharp +public string MethodName { get; set; } + +``` +--- + +# Class PackageBuildResult + + +资源包裹构建的返回结果 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/PackageBuilder/PackageBuildResult.cs#L7) + +Declaration +```csharp +public class PackageBuildResult + +``` + +## Properties + + +### PackageRootDirectory + + +构建输出的资源包裹根目录路径 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/PackageBuilder/PackageBuildResult.cs#L12) + +Declaration +```csharp +public string PackageRootDirectory { get; } + +``` +--- + +# Class PackageDetails + + +资源包裹的详细信息,用于外部查询包裹配置。 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/PackageDetails.cs#L7) + +Declaration +```csharp +public class PackageDetails + +``` + +## Properties + + +### FileVersion + + +文件版本 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/PackageDetails.cs#L12) + +Declaration +```csharp +public int FileVersion { get; } + +``` + +### EnableAddressable + + +启用可寻址资源定位 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/PackageDetails.cs#L17) + +Declaration +```csharp +public bool EnableAddressable { get; } + +``` + +### SupportExtensionless + + +支持无后缀名的资源定位地址 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/PackageDetails.cs#L22) + +Declaration +```csharp +public bool SupportExtensionless { get; } + +``` + +### LocationToLower + + +资源定位地址大小写不敏感 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/PackageDetails.cs#L27) + +Declaration +```csharp +public bool LocationToLower { get; } + +``` + +### IncludeAssetGuid + + +包含资源GUID数据 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/PackageDetails.cs#L32) + +Declaration +```csharp +public bool IncludeAssetGuid { get; } + +``` + +### ReplaceAssetPathWithAddress + + +使用可寻址地址代替资源路径 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/PackageDetails.cs#L37) + +Declaration +```csharp +public bool ReplaceAssetPathWithAddress { get; } + +``` + +### OutputNameStyle + + +文件名称样式 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/PackageDetails.cs#L42) + +Declaration +```csharp +public int OutputNameStyle { get; } + +``` + +### BuildBundleType + + +构建资源包类型 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/PackageDetails.cs#L47) + +Declaration +```csharp +public int BuildBundleType { get; } + +``` + +### BuildPipeline + + +构建管线名称 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/PackageDetails.cs#L52) + +Declaration +```csharp +public string BuildPipeline { get; } + +``` + +### PackageName + + +资源包裹名称 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/PackageDetails.cs#L57) + +Declaration +```csharp +public string PackageName { get; } + +``` + +### PackageVersion + + +资源包裹的版本信息 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/PackageDetails.cs#L62) + +Declaration +```csharp +public string PackageVersion { get; } + +``` + +### PackageNote + + +资源包裹的备注信息 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/PackageDetails.cs#L67) + +Declaration +```csharp +public string PackageNote { get; } + +``` + +### AssetTotalCount + + +主资源文件总数 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/PackageDetails.cs#L72) + +Declaration +```csharp +public int AssetTotalCount { get; } + +``` + +### BundleTotalCount + + +资源包文件总数 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/PackageDetails.cs#L77) + +Declaration +```csharp +public int BundleTotalCount { get; } + +``` +--- + +# Class PrefetchManifestOperation + + +预取清单操作,用于提前加载指定版本的资源清单。 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/PrefetchManifestOperation.cs#L10) + +Declaration +```csharp +public sealed class PrefetchManifestOperation : AsyncOperationBase, IEnumerator, IComparable + +``` + +## Methods + + +### InternalStart() + + +内部启动方法(子类必须实现) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/PrefetchManifestOperation.cs#L34) + +Declaration +```csharp +protected override void InternalStart() + +``` + +### InternalUpdate() + + +内部更新方法(子类必须实现) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/PrefetchManifestOperation.cs#L39) + +Declaration +```csharp +protected override void InternalUpdate() + +``` + +### CreateResourceDownloader(ResourceDownloaderOptions) + + +创建资源下载器,用于下载指定的资源标签列表关联的资源包文件。 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/PrefetchManifestOperation.cs#L113) + +Declaration +```csharp +public ResourceDownloaderOperation CreateResourceDownloader(ResourceDownloaderOptions options) + +``` + +##### Returns + + +[YooAsset.ResourceDownloaderOperation](/docs/api/YooAsset/ResourceDownloaderOperation): 资源下载操作实例 + + +##### Parameters + +TypeNameDescription[YooAsset.ResourceDownloaderOptions](/docs/api/YooAsset/ResourceDownloaderOptions)*options*资源下载选项 + +### CreateBundleDownloader(BundleDownloaderOptions) + + +创建资源下载器,用于下载指定的资源信息列表依赖的资源包文件。 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/PrefetchManifestOperation.cs#L129) + +Declaration +```csharp +public ResourceDownloaderOperation CreateBundleDownloader(BundleDownloaderOptions options) + +``` + +##### Returns + + +[YooAsset.ResourceDownloaderOperation](/docs/api/YooAsset/ResourceDownloaderOperation): 资源下载操作实例 + + +##### Parameters + +TypeNameDescription[YooAsset.BundleDownloaderOptions](/docs/api/YooAsset/BundleDownloaderOptions)*options*资源包下载选项 + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IComparable`` +--- + +# Struct PrefetchManifestOptions + + +预取清单的操作选项 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/PrefetchManifestOptions.cs#L7) + +Declaration +```csharp +public readonly struct PrefetchManifestOptions + +``` + +## Properties + + +### PackageVersion + + +预取的包裹版本 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/PrefetchManifestOptions.cs#L12) + +Declaration +```csharp +public string PackageVersion { get; } + +``` + +### Timeout + + +资源清单请求超时时间 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/PrefetchManifestOptions.cs#L17) + +Declaration +```csharp +public int Timeout { get; } + +``` +--- + +# Class RawFileHandle + + +原生文件句柄,用于访问未经 Unity 处理的原始文件。 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Handles/RawFileHandle.cs#L7) + +Declaration +```csharp +public sealed class RawFileHandle : HandleBase, IEnumerator, IDisposable + +``` + +## Methods + + +### WaitForAsyncComplete() + + +等待异步执行完毕 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Handles/RawFileHandle.cs#L44) + +Declaration +```csharp +public void WaitForAsyncComplete() + +``` + +### GetRawFilePath() + + +获取原生文件的路径 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Handles/RawFileHandle.cs#L55) + +Declaration +```csharp +public string GetRawFilePath() + +``` + +##### Returns + + +``System.String``: 原生文件的磁盘路径## Events + + +### Completed + + +当加载完成时触发 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Handles/RawFileHandle.cs#L22) + +Declaration +```csharp +public event Action Completed + +``` + +##### Event Type + + +``System.Action`` + + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IDisposable`` +--- + +# Class RawFileObject + + +原生文件对象 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/BundleHandle/Services/RawBundleHandle/RawFileObject.cs#L10) + +Declaration +```csharp +public class RawFileObject : ScriptableObject + +``` + +## Methods + + +### GetBytes() + + +获取原生文件的字节数据 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/BundleHandle/Services/RawBundleHandle/RawFileObject.cs#L19) + +Declaration +```csharp +public byte[] GetBytes() + +``` + +##### Returns + + +``System.Byte[]``: 原生文件字节数据的副本### GetText() +获取以 UTF-8 编码解析的文本内容 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/BundleHandle/Services/RawBundleHandle/RawFileObject.cs#L32) + +Declaration +```csharp +public string GetText() + +``` + +##### Returns + + +``System.String``: 解析后的文本字符串 +--- + +# Class RequestPackageVersionOperation + + +请求包裹版本操作 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/RequestPackageVersionOperation.cs#L7) + +Declaration +```csharp +public sealed class RequestPackageVersionOperation : AsyncOperationBase, IEnumerator, IComparable + +``` + +## Properties + + +### PackageVersion + + +当前最新的包裹版本 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/RequestPackageVersionOperation.cs#L24) + +Declaration +```csharp +public string PackageVersion { get; } + +``` + +## Methods + + +### InternalStart() + + +内部启动方法(子类必须实现) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/RequestPackageVersionOperation.cs#L33) + +Declaration +```csharp +protected override void InternalStart() + +``` + +### InternalUpdate() + + +内部更新方法(子类必须实现) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/RequestPackageVersionOperation.cs#L38) + +Declaration +```csharp +protected override void InternalUpdate() + +``` + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IComparable`` +--- + +# Struct RequestPackageVersionOptions + + +请求版本的操作选项 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/RequestPackageVersionOptions.cs#L7) + +Declaration +```csharp +public readonly struct RequestPackageVersionOptions + +``` + +## Properties + + +### AppendTimeTicks + + +是否在URL末尾添加时间戳 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/RequestPackageVersionOptions.cs#L12) + +Declaration +```csharp +public bool AppendTimeTicks { get; } + +``` + +### Timeout + + +超时时间 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/RequestPackageVersionOptions.cs#L17) + +Declaration +```csharp +public int Timeout { get; } + +``` +--- + +# Class ResourceDownloaderOperation + + +资源下载操作类 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderOperation.cs#L409) + +Declaration +```csharp +public sealed class ResourceDownloaderOperation : DownloaderOperation, IEnumerator, IComparable + +``` + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IComparable`` +--- + +# Struct ResourceDownloaderOptions + + +按资源标签创建下载器的操作选项 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderOptions.cs#L64) + +Declaration +```csharp +public readonly struct ResourceDownloaderOptions + +``` + +## Properties + + +### MaximumConcurrency + + +最大并发数量 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderOptions.cs#L69) + +Declaration +```csharp +public int MaximumConcurrency { get; } + +``` + +### RetryCount + + +失败后的重试次数 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderOptions.cs#L74) + +Declaration +```csharp +public int RetryCount { get; } + +``` + +### Tags + + +资源标签列表 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderOptions.cs#L80) + +Declaration +```csharp +public string[] Tags { get; } + +``` +--- + +# Class ResourceImporterOperation + + +资源导入操作类 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderOperation.cs#L449) + +Declaration +```csharp +public sealed class ResourceImporterOperation : DownloaderOperation, IEnumerator, IComparable + +``` + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IComparable`` +--- + +# Class ResourcePackage + + +资源包裹类 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L12) + +Declaration +```csharp +public class ResourcePackage + +``` + +## Properties + + +### PackageName + + +包裹名称 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L21) + +Declaration +```csharp +public string PackageName { get; } + +``` + +### PackageValid + + +包裹是否有效 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L26) + +Declaration +```csharp +public bool PackageValid { get; } + +``` + +### PackagePriority + + +包裹优先级(值越大越优先更新) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L39) + +Declaration +```csharp +public uint PackagePriority { get; set; } + +``` + +### InitializeStatus + + +初始化状态 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L48) + +Declaration +```csharp +public EOperationStatus InitializeStatus { get; } + +``` + +## Methods + + +### InitializePackageAsync(InitializePackageOptions) + + +初始化包裹 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L91) + +Declaration +```csharp +public InitializePackageOperation InitializePackageAsync(InitializePackageOptions options) + +``` + +##### Returns + + +[YooAsset.InitializePackageOperation](/docs/api/YooAsset/InitializePackageOperation): 返回初始化操作对象 + + +##### Parameters + +TypeNameDescription[YooAsset.InitializePackageOptions](/docs/api/YooAsset/InitializePackageOptions)*options*初始化参数 + +### DestroyPackageAsync() + + +销毁包裹 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L120) + +Declaration +```csharp +public DestroyPackageOperation DestroyPackageAsync() + +``` + +##### Returns + + +[YooAsset.DestroyPackageOperation](/docs/api/YooAsset/DestroyPackageOperation): 返回销毁包裹操作对象### RequestPackageVersionAsync() +请求最新的资源版本 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L133) + +Declaration +```csharp +public RequestPackageVersionOperation RequestPackageVersionAsync() + +``` + +##### Returns + + +[YooAsset.RequestPackageVersionOperation](/docs/api/YooAsset/RequestPackageVersionOperation): 返回请求版本操作对象### RequestPackageVersionAsync(RequestPackageVersionOptions) +请求最新的资源版本 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L145) + +Declaration +```csharp +public RequestPackageVersionOperation RequestPackageVersionAsync(RequestPackageVersionOptions options) + +``` + +##### Returns + + +[YooAsset.RequestPackageVersionOperation](/docs/api/YooAsset/RequestPackageVersionOperation): 返回请求版本操作对象 + + +##### Parameters + +TypeNameDescription[YooAsset.RequestPackageVersionOptions](/docs/api/YooAsset/RequestPackageVersionOptions)*options*请求版本选项 + +### LoadPackageManifestAsync(LoadPackageManifestOptions) + + +加载指定版本的资源清单 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L158) + +Declaration +```csharp +public LoadPackageManifestOperation LoadPackageManifestAsync(LoadPackageManifestOptions options) + +``` + +##### Returns + + +[YooAsset.LoadPackageManifestOperation](/docs/api/YooAsset/LoadPackageManifestOperation): 返回加载清单操作对象 + + +##### Parameters + +TypeNameDescription[YooAsset.LoadPackageManifestOptions](/docs/api/YooAsset/LoadPackageManifestOptions)*options*加载清单选项 + +### PrefetchManifestAsync(PrefetchManifestOptions) + + +预取指定版本的包裹资源清单 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L178) + +Declaration +```csharp +public PrefetchManifestOperation PrefetchManifestAsync(PrefetchManifestOptions options) + +``` + +##### Returns + + +[YooAsset.PrefetchManifestOperation](/docs/api/YooAsset/PrefetchManifestOperation): 返回预取清单操作对象 + + +##### Parameters + +TypeNameDescription[YooAsset.PrefetchManifestOptions](/docs/api/YooAsset/PrefetchManifestOptions)*options*预取清单选项 + +### ClearCacheAsync(ClearCacheOptions) + + +清理缓存文件 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L191) + +Declaration +```csharp +public ClearCacheOperation ClearCacheAsync(ClearCacheOptions options) + +``` + +##### Returns + + +[YooAsset.ClearCacheOperation](/docs/api/YooAsset/ClearCacheOperation): 返回清理缓存操作对象 + + +##### Parameters + +TypeNameDescription[YooAsset.ClearCacheOptions](/docs/api/YooAsset/ClearCacheOptions)*options*清理缓存选项 + +### GetPackageVersion() + + +获取当前加载包裹的版本信息 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L205) + +Declaration +```csharp +public string GetPackageVersion() + +``` + +##### Returns + + +``System.String``: 返回当前包裹版本字符串### GetPackageNote() +获取当前加载包裹的备注信息 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L215) + +Declaration +```csharp +public string GetPackageNote() + +``` + +##### Returns + + +``System.String``: 返回当前包裹备注字符串### GetPackageDetails() +获取当前加载包裹的详细信息 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L225) + +Declaration +```csharp +public PackageDetails GetPackageDetails() + +``` + +##### Returns + + +[YooAsset.PackageDetails](/docs/api/YooAsset/PackageDetails): 返回包含包裹配置的详细信息对象### UnloadAllAssetsAsync() +强制回收所有资源 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L237) + +Declaration +```csharp +public UnloadAllAssetsOperation UnloadAllAssetsAsync() + +``` + +##### Returns + + +[YooAsset.UnloadAllAssetsOperation](/docs/api/YooAsset/UnloadAllAssetsOperation): 返回卸载资源操作对象### UnloadAllAssetsAsync(UnloadAllAssetsOptions) +强制回收所有资源 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L248) + +Declaration +```csharp +public UnloadAllAssetsOperation UnloadAllAssetsAsync(UnloadAllAssetsOptions options) + +``` + +##### Returns + + +[YooAsset.UnloadAllAssetsOperation](/docs/api/YooAsset/UnloadAllAssetsOperation): 返回卸载资源操作对象 + + +##### Parameters + +TypeNameDescription[YooAsset.UnloadAllAssetsOptions](/docs/api/YooAsset/UnloadAllAssetsOptions)*options*卸载选项 + +### UnloadUnusedAssetsAsync() + + +回收不再使用的资源 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L261) + +Declaration +```csharp +public UnloadUnusedAssetsOperation UnloadUnusedAssetsAsync() + +``` + +##### Returns + + +[YooAsset.UnloadUnusedAssetsOperation](/docs/api/YooAsset/UnloadUnusedAssetsOperation): 返回卸载未使用资源操作对象### UnloadUnusedAssetsAsync(UnloadUnusedAssetsOptions) +回收不再使用的资源 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L274) + +Declaration +```csharp +public UnloadUnusedAssetsOperation UnloadUnusedAssetsAsync(UnloadUnusedAssetsOptions options) + +``` + +##### Returns + + +[YooAsset.UnloadUnusedAssetsOperation](/docs/api/YooAsset/UnloadUnusedAssetsOperation): 返回卸载未使用资源操作对象 + + +##### Parameters + +TypeNameDescription[YooAsset.UnloadUnusedAssetsOptions](/docs/api/YooAsset/UnloadUnusedAssetsOptions)*options*卸载选项 + +### TryUnloadUnusedAsset(string, int) + + +尝试卸载指定的未使用资源 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L287) + +Declaration +```csharp +public void TryUnloadUnusedAsset(string location, int loopCount = 10) + +``` + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.Int32``*loopCount*最大循环卸载次数 + +### TryUnloadUnusedAsset(AssetInfo, int) + + +尝试卸载指定的未使用资源 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L299) + +Declaration +```csharp +public void TryUnloadUnusedAsset(AssetInfo assetInfo, int loopCount = 10) + +``` + +##### Parameters + +TypeNameDescription[YooAsset.AssetInfo](/docs/api/YooAsset/AssetInfo)*assetInfo*资源信息``System.Int32``*loopCount*最大循环卸载次数 + +### GetDownloadSize(string) + + +获取指定资源需要下载的文件总大小 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L312) + +Declaration +```csharp +public long GetDownloadSize(string location) + +``` + +##### Returns + + +``System.Int64``: 返回需要下载的字节数,0 表示不需要下载。 + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址 + +### GetDownloadSize(AssetInfo) + + +获取指定资源需要下载的文件总大小 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L324) + +Declaration +```csharp +public long GetDownloadSize(AssetInfo assetInfo) + +``` + +##### Returns + + +``System.Int64``: 返回需要下载的字节数,0 表示不需要下载。 + + +##### Parameters + +TypeNameDescription[YooAsset.AssetInfo](/docs/api/YooAsset/AssetInfo)*assetInfo*资源信息 + +### GetAllAssetInfos() + + +获取所有的资源信息 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L334) + +Declaration +```csharp +public AssetInfo[] GetAllAssetInfos() + +``` + +##### Returns + + +``YooAsset.AssetInfo[]``: 返回包含所有资源信息的数组### GetAssetInfos(string) +获取资源信息列表 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L345) + +Declaration +```csharp +public AssetInfo[] GetAssetInfos(string tag) + +``` + +##### Returns + + +``YooAsset.AssetInfo[]``: 返回匹配标签的资源信息数组 + + +##### Parameters + +TypeNameDescription``System.String``*tag*资源标签 + +### GetAssetInfos(string[]) + + +获取资源信息列表 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L357) + +Declaration +```csharp +public AssetInfo[] GetAssetInfos(string[] tags) + +``` + +##### Returns + + +``YooAsset.AssetInfo[]``: 返回匹配标签的资源信息数组 + + +##### Parameters + +TypeNameDescription``System.String[]``*tags*资源标签列表 + +### GetAssetInfo(string) + + +获取资源信息 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L368) + +Declaration +```csharp +public AssetInfo GetAssetInfo(string location) + +``` + +##### Returns + + +[YooAsset.AssetInfo](/docs/api/YooAsset/AssetInfo): 返回资源信息对象 + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址 + +### GetAssetInfo(string, Type) + + +获取资源信息 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L380) + +Declaration +```csharp +public AssetInfo GetAssetInfo(string location, Type type) + +``` + +##### Returns + + +[YooAsset.AssetInfo](/docs/api/YooAsset/AssetInfo): 返回资源信息对象 + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.Type``*type*资源类型 + +### GetAssetInfoByGuid(string) + + +获取资源信息 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L391) + +Declaration +```csharp +public AssetInfo GetAssetInfoByGuid(string assetGuid) + +``` + +##### Returns + + +[YooAsset.AssetInfo](/docs/api/YooAsset/AssetInfo): 返回资源信息对象 + + +##### Parameters + +TypeNameDescription``System.String``*assetGuid*资源GUID + +### GetAssetInfoByGuid(string, Type) + + +获取资源信息 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L403) + +Declaration +```csharp +public AssetInfo GetAssetInfoByGuid(string assetGuid, Type type) + +``` + +##### Returns + + +[YooAsset.AssetInfo](/docs/api/YooAsset/AssetInfo): 返回资源信息对象 + + +##### Parameters + +TypeNameDescription``System.String``*assetGuid*资源GUID``System.Type``*type*资源类型 + +### IsLocationValid(string) + + +资源定位地址是否有效 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L414) + +Declaration +```csharp +public bool IsLocationValid(string location) + +``` + +##### Returns + + +``System.Boolean``: 如果地址有效返回true,否则返回false。 + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址 + +### LoadSceneSync(string, LoadSceneMode, LocalPhysicsMode) + + +同步加载场景 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L430) + +Declaration +```csharp +public SceneHandle LoadSceneSync(string location, LoadSceneMode sceneMode = LoadSceneMode.Single, LocalPhysicsMode physicsMode = LocalPhysicsMode.None) + +``` + +##### Returns + + +[YooAsset.SceneHandle](/docs/api/YooAsset/SceneHandle): 返回场景操作句柄 + + +##### Parameters + +TypeNameDescription``System.String``*location*场景的定位地址``UnityEngine.SceneManagement.LoadSceneMode``*sceneMode*场景加载模式``UnityEngine.SceneManagement.LocalPhysicsMode``*physicsMode*场景物理模式 + +### LoadSceneSync(AssetInfo, LoadSceneMode, LocalPhysicsMode) + + +同步加载场景 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L444) + +Declaration +```csharp +public SceneHandle LoadSceneSync(AssetInfo assetInfo, LoadSceneMode sceneMode = LoadSceneMode.Single, LocalPhysicsMode physicsMode = LocalPhysicsMode.None) + +``` + +##### Returns + + +[YooAsset.SceneHandle](/docs/api/YooAsset/SceneHandle): 返回场景操作句柄 + + +##### Parameters + +TypeNameDescription[YooAsset.AssetInfo](/docs/api/YooAsset/AssetInfo)*assetInfo*场景的资源信息``UnityEngine.SceneManagement.LoadSceneMode``*sceneMode*场景加载模式``UnityEngine.SceneManagement.LocalPhysicsMode``*physicsMode*场景物理模式 + +### LoadSceneAsync(string, LoadSceneMode, LocalPhysicsMode, bool, uint) + + +加载场景 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L459) + +Declaration +```csharp +public SceneHandle LoadSceneAsync(string location, LoadSceneMode sceneMode = LoadSceneMode.Single, LocalPhysicsMode physicsMode = LocalPhysicsMode.None, bool allowSceneActivation = true, uint priority = 0) + +``` + +##### Returns + + +[YooAsset.SceneHandle](/docs/api/YooAsset/SceneHandle): 返回场景操作句柄 + + +##### Parameters + +TypeNameDescription``System.String``*location*场景的定位地址``UnityEngine.SceneManagement.LoadSceneMode``*sceneMode*场景加载模式``UnityEngine.SceneManagement.LocalPhysicsMode``*physicsMode*场景物理模式``System.Boolean``*allowSceneActivation*是否允许场景激活``System.UInt32``*priority*加载的优先级 + +### LoadSceneAsync(AssetInfo, LoadSceneMode, LocalPhysicsMode, bool, uint) + + +加载场景 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L475) + +Declaration +```csharp +public SceneHandle LoadSceneAsync(AssetInfo assetInfo, LoadSceneMode sceneMode = LoadSceneMode.Single, LocalPhysicsMode physicsMode = LocalPhysicsMode.None, bool allowSceneActivation = true, uint priority = 0) + +``` + +##### Returns + + +[YooAsset.SceneHandle](/docs/api/YooAsset/SceneHandle): 返回场景操作句柄 + + +##### Parameters + +TypeNameDescription[YooAsset.AssetInfo](/docs/api/YooAsset/AssetInfo)*assetInfo*场景的资源信息``UnityEngine.SceneManagement.LoadSceneMode``*sceneMode*场景加载模式``UnityEngine.SceneManagement.LocalPhysicsMode``*physicsMode*场景物理模式``System.Boolean``*allowSceneActivation*是否允许场景激活``System.UInt32``*priority*加载的优先级 + +### LoadAssetSync(AssetInfo) + + +同步加载资源对象 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L499) + +Declaration +```csharp +public AssetHandle LoadAssetSync(AssetInfo assetInfo) + +``` + +##### Returns + + +[YooAsset.AssetHandle](/docs/api/YooAsset/AssetHandle): 返回资源操作句柄 + + +##### Parameters + +TypeNameDescription[YooAsset.AssetInfo](/docs/api/YooAsset/AssetInfo)*assetInfo*资源信息 + +### LoadAssetSync(string) + + +同步加载资源对象 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L511) + +Declaration +```csharp +public AssetHandle LoadAssetSync(string location) where TObject : Object + +``` + +##### Returns + + +[YooAsset.AssetHandle](/docs/api/YooAsset/AssetHandle): 返回资源操作句柄 + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址 + +##### Type Parameters + +NameDescription``TObject``资源类型 + +### LoadAssetSync(string, Type) + + +同步加载资源对象 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L524) + +Declaration +```csharp +public AssetHandle LoadAssetSync(string location, Type type) + +``` + +##### Returns + + +[YooAsset.AssetHandle](/docs/api/YooAsset/AssetHandle): 返回资源操作句柄 + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.Type``*type*资源类型 + +### LoadAssetSync(string) + + +同步加载资源对象 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L536) + +Declaration +```csharp +public AssetHandle LoadAssetSync(string location) + +``` + +##### Returns + + +[YooAsset.AssetHandle](/docs/api/YooAsset/AssetHandle): 返回资源操作句柄 + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址 + +### LoadAssetAsync(AssetInfo, uint) + + +加载资源对象 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L550) + +Declaration +```csharp +public AssetHandle LoadAssetAsync(AssetInfo assetInfo, uint priority = 0) + +``` + +##### Returns + + +[YooAsset.AssetHandle](/docs/api/YooAsset/AssetHandle): 返回资源操作句柄 + + +##### Parameters + +TypeNameDescription[YooAsset.AssetInfo](/docs/api/YooAsset/AssetInfo)*assetInfo*资源信息``System.UInt32``*priority*加载的优先级 + +### LoadAssetAsync(string, uint) + + +加载资源对象 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L563) + +Declaration +```csharp +public AssetHandle LoadAssetAsync(string location, uint priority = 0) where TObject : Object + +``` + +##### Returns + + +[YooAsset.AssetHandle](/docs/api/YooAsset/AssetHandle): 返回资源操作句柄 + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.UInt32``*priority*加载的优先级 + +##### Type Parameters + +NameDescription``TObject``资源类型 + +### LoadAssetAsync(string, Type, uint) + + +加载资源对象 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L577) + +Declaration +```csharp +public AssetHandle LoadAssetAsync(string location, Type type, uint priority = 0) + +``` + +##### Returns + + +[YooAsset.AssetHandle](/docs/api/YooAsset/AssetHandle): 返回资源操作句柄 + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.Type``*type*资源类型``System.UInt32``*priority*加载的优先级 + +### LoadAssetAsync(string, uint) + + +加载资源对象 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L590) + +Declaration +```csharp +public AssetHandle LoadAssetAsync(string location, uint priority = 0) + +``` + +##### Returns + + +[YooAsset.AssetHandle](/docs/api/YooAsset/AssetHandle): 返回资源操作句柄 + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.UInt32``*priority*加载的优先级 + +### LoadSubAssetsSync(AssetInfo) + + +同步加载子资源对象 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L615) + +Declaration +```csharp +public SubAssetsHandle LoadSubAssetsSync(AssetInfo assetInfo) + +``` + +##### Returns + + +[YooAsset.SubAssetsHandle](/docs/api/YooAsset/SubAssetsHandle): 返回子资源操作句柄 + + +##### Parameters + +TypeNameDescription[YooAsset.AssetInfo](/docs/api/YooAsset/AssetInfo)*assetInfo*资源信息 + +### LoadSubAssetsSync(string) + + +同步加载子资源对象 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L627) + +Declaration +```csharp +public SubAssetsHandle LoadSubAssetsSync(string location) where TObject : Object + +``` + +##### Returns + + +[YooAsset.SubAssetsHandle](/docs/api/YooAsset/SubAssetsHandle): 返回子资源操作句柄 + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址 + +##### Type Parameters + +NameDescription``TObject``资源类型 + +### LoadSubAssetsSync(string, Type) + + +同步加载子资源对象 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L640) + +Declaration +```csharp +public SubAssetsHandle LoadSubAssetsSync(string location, Type type) + +``` + +##### Returns + + +[YooAsset.SubAssetsHandle](/docs/api/YooAsset/SubAssetsHandle): 返回子资源操作句柄 + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.Type``*type*子对象类型 + +### LoadSubAssetsSync(string) + + +同步加载子资源对象 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L652) + +Declaration +```csharp +public SubAssetsHandle LoadSubAssetsSync(string location) + +``` + +##### Returns + + +[YooAsset.SubAssetsHandle](/docs/api/YooAsset/SubAssetsHandle): 返回子资源操作句柄 + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址 + +### LoadSubAssetsAsync(AssetInfo, uint) + + +加载子资源对象 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L666) + +Declaration +```csharp +public SubAssetsHandle LoadSubAssetsAsync(AssetInfo assetInfo, uint priority = 0) + +``` + +##### Returns + + +[YooAsset.SubAssetsHandle](/docs/api/YooAsset/SubAssetsHandle): 返回子资源操作句柄 + + +##### Parameters + +TypeNameDescription[YooAsset.AssetInfo](/docs/api/YooAsset/AssetInfo)*assetInfo*资源信息``System.UInt32``*priority*加载的优先级 + +### LoadSubAssetsAsync(string, uint) + + +加载子资源对象 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L679) + +Declaration +```csharp +public SubAssetsHandle LoadSubAssetsAsync(string location, uint priority = 0) where TObject : Object + +``` + +##### Returns + + +[YooAsset.SubAssetsHandle](/docs/api/YooAsset/SubAssetsHandle): 返回子资源操作句柄 + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.UInt32``*priority*加载的优先级 + +##### Type Parameters + +NameDescription``TObject``资源类型 + +### LoadSubAssetsAsync(string, Type, uint) + + +加载子资源对象 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L693) + +Declaration +```csharp +public SubAssetsHandle LoadSubAssetsAsync(string location, Type type, uint priority = 0) + +``` + +##### Returns + + +[YooAsset.SubAssetsHandle](/docs/api/YooAsset/SubAssetsHandle): 返回子资源操作句柄 + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.Type``*type*子对象类型``System.UInt32``*priority*加载的优先级 + +### LoadSubAssetsAsync(string, uint) + + +加载子资源对象 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L706) + +Declaration +```csharp +public SubAssetsHandle LoadSubAssetsAsync(string location, uint priority = 0) + +``` + +##### Returns + + +[YooAsset.SubAssetsHandle](/docs/api/YooAsset/SubAssetsHandle): 返回子资源操作句柄 + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.UInt32``*priority*加载的优先级 + +### LoadAllAssetsSync(AssetInfo) + + +同步加载资源包内所有资源对象 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L731) + +Declaration +```csharp +public AllAssetsHandle LoadAllAssetsSync(AssetInfo assetInfo) + +``` + +##### Returns + + +[YooAsset.AllAssetsHandle](/docs/api/YooAsset/AllAssetsHandle): 返回全资源操作句柄 + + +##### Parameters + +TypeNameDescription[YooAsset.AssetInfo](/docs/api/YooAsset/AssetInfo)*assetInfo*资源信息 + +### LoadAllAssetsSync(string) + + +同步加载资源包内所有资源对象 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L743) + +Declaration +```csharp +public AllAssetsHandle LoadAllAssetsSync(string location) where TObject : Object + +``` + +##### Returns + + +[YooAsset.AllAssetsHandle](/docs/api/YooAsset/AllAssetsHandle): 返回全资源操作句柄 + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址 + +##### Type Parameters + +NameDescription``TObject``资源类型 + +### LoadAllAssetsSync(string, Type) + + +同步加载资源包内所有资源对象 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L756) + +Declaration +```csharp +public AllAssetsHandle LoadAllAssetsSync(string location, Type type) + +``` + +##### Returns + + +[YooAsset.AllAssetsHandle](/docs/api/YooAsset/AllAssetsHandle): 返回全资源操作句柄 + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.Type``*type*子对象类型 + +### LoadAllAssetsSync(string) + + +同步加载资源包内所有资源对象 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L768) + +Declaration +```csharp +public AllAssetsHandle LoadAllAssetsSync(string location) + +``` + +##### Returns + + +[YooAsset.AllAssetsHandle](/docs/api/YooAsset/AllAssetsHandle): 返回全资源操作句柄 + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址 + +### LoadAllAssetsAsync(AssetInfo, uint) + + +加载资源包内所有资源对象 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L782) + +Declaration +```csharp +public AllAssetsHandle LoadAllAssetsAsync(AssetInfo assetInfo, uint priority = 0) + +``` + +##### Returns + + +[YooAsset.AllAssetsHandle](/docs/api/YooAsset/AllAssetsHandle): 返回全资源操作句柄 + + +##### Parameters + +TypeNameDescription[YooAsset.AssetInfo](/docs/api/YooAsset/AssetInfo)*assetInfo*资源信息``System.UInt32``*priority*加载的优先级 + +### LoadAllAssetsAsync(string, uint) + + +加载资源包内所有资源对象 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L795) + +Declaration +```csharp +public AllAssetsHandle LoadAllAssetsAsync(string location, uint priority = 0) where TObject : Object + +``` + +##### Returns + + +[YooAsset.AllAssetsHandle](/docs/api/YooAsset/AllAssetsHandle): 返回全资源操作句柄 + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.UInt32``*priority*加载的优先级 + +##### Type Parameters + +NameDescription``TObject``资源类型 + +### LoadAllAssetsAsync(string, Type, uint) + + +加载资源包内所有资源对象 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L809) + +Declaration +```csharp +public AllAssetsHandle LoadAllAssetsAsync(string location, Type type, uint priority = 0) + +``` + +##### Returns + + +[YooAsset.AllAssetsHandle](/docs/api/YooAsset/AllAssetsHandle): 返回全资源操作句柄 + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.Type``*type*子对象类型``System.UInt32``*priority*加载的优先级 + +### LoadAllAssetsAsync(string, uint) + + +加载资源包内所有资源对象 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L822) + +Declaration +```csharp +public AllAssetsHandle LoadAllAssetsAsync(string location, uint priority = 0) + +``` + +##### Returns + + +[YooAsset.AllAssetsHandle](/docs/api/YooAsset/AllAssetsHandle): 返回全资源操作句柄 + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.UInt32``*priority*加载的优先级 + +### EnsureBundleFileAsync(EnsureBundleFileOptions) + + +确保资源包文件已就绪 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L847) + +Declaration +```csharp +public EnsureBundleFileOperation EnsureBundleFileAsync(EnsureBundleFileOptions options) + +``` + +##### Returns + + +[YooAsset.EnsureBundleFileOperation](/docs/api/YooAsset/EnsureBundleFileOperation): 返回确保资源包文件就绪的操作对象 + + +##### Parameters + +TypeNameDescription[YooAsset.EnsureBundleFileOptions](/docs/api/YooAsset/EnsureBundleFileOptions)*options*确保资源包文件已就绪的选项 + +### LoadBundleFileSync(AssetInfo) + + +同步加载资源包文件 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L866) + +Declaration +```csharp +public BundleFileHandle LoadBundleFileSync(AssetInfo assetInfo) + +``` + +##### Returns + + +[YooAsset.BundleFileHandle](/docs/api/YooAsset/BundleFileHandle): 返回资源包文件操作句柄 + + +##### Parameters + +TypeNameDescription[YooAsset.AssetInfo](/docs/api/YooAsset/AssetInfo)*assetInfo*资源信息 + +### LoadBundleFileSync(string) + + +同步加载资源包文件 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L877) + +Declaration +```csharp +public BundleFileHandle LoadBundleFileSync(string location) + +``` + +##### Returns + + +[YooAsset.BundleFileHandle](/docs/api/YooAsset/BundleFileHandle): 返回资源包文件操作句柄 + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址 + +### LoadBundleFileAsync(AssetInfo, uint) + + +异步加载资源包文件 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L890) + +Declaration +```csharp +public BundleFileHandle LoadBundleFileAsync(AssetInfo assetInfo, uint priority = 0) + +``` + +##### Returns + + +[YooAsset.BundleFileHandle](/docs/api/YooAsset/BundleFileHandle): 返回资源包文件操作句柄 + + +##### Parameters + +TypeNameDescription[YooAsset.AssetInfo](/docs/api/YooAsset/AssetInfo)*assetInfo*资源信息``System.UInt32``*priority*加载的优先级 + +### LoadBundleFileAsync(string, uint) + + +异步加载资源包文件 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L902) + +Declaration +```csharp +public BundleFileHandle LoadBundleFileAsync(string location, uint priority = 0) + +``` + +##### Returns + + +[YooAsset.BundleFileHandle](/docs/api/YooAsset/BundleFileHandle): 返回资源包文件操作句柄 + + +##### Parameters + +TypeNameDescription``System.String``*location*资源的定位地址``System.UInt32``*priority*加载的优先级 + +### CreateResourceDownloader(ResourceDownloaderOptions) + + +创建资源下载器,用于下载指定的资源标签关联的资源包文件。 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L925) + +Declaration +```csharp +public ResourceDownloaderOperation CreateResourceDownloader(ResourceDownloaderOptions options) + +``` + +##### Returns + + +[YooAsset.ResourceDownloaderOperation](/docs/api/YooAsset/ResourceDownloaderOperation): 返回资源下载操作对象 + + +##### Parameters + +TypeNameDescription[YooAsset.ResourceDownloaderOptions](/docs/api/YooAsset/ResourceDownloaderOptions)*options*资源下载选项 + +### CreateResourceDownloader(BundleDownloaderOptions) + + +创建资源下载器,用于下载指定的资源信息列表依赖的资源包文件。 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L936) + +Declaration +```csharp +public ResourceDownloaderOperation CreateResourceDownloader(BundleDownloaderOptions options) + +``` + +##### Returns + + +[YooAsset.ResourceDownloaderOperation](/docs/api/YooAsset/ResourceDownloaderOperation): 返回资源下载操作对象 + + +##### Parameters + +TypeNameDescription[YooAsset.BundleDownloaderOptions](/docs/api/YooAsset/BundleDownloaderOptions)*options*资源下载选项 + +### CreateResourceUnpacker(ResourceUnpackerOptions) + + +创建内置资源解压器,用于解压指定的资源标签关联的资源包文件。 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L949) + +Declaration +```csharp +public ResourceUnpackerOperation CreateResourceUnpacker(ResourceUnpackerOptions options) + +``` + +##### Returns + + +[YooAsset.ResourceUnpackerOperation](/docs/api/YooAsset/ResourceUnpackerOperation): 返回资源解压操作对象 + + +##### Parameters + +TypeNameDescription[YooAsset.ResourceUnpackerOptions](/docs/api/YooAsset/ResourceUnpackerOptions)*options*资源解压选项 + +### CreateResourceImporter(BundleImporterOptions) + + +创建资源导入器 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/ResourcePackage.cs#L962) + +Declaration +```csharp +public ResourceImporterOperation CreateResourceImporter(BundleImporterOptions options) + +``` + +##### Returns + + +[YooAsset.ResourceImporterOperation](/docs/api/YooAsset/ResourceImporterOperation): 返回资源导入操作对象 + + +##### Parameters + +TypeNameDescription[YooAsset.BundleImporterOptions](/docs/api/YooAsset/BundleImporterOptions)*options*资源导入选项 +--- + +# Class ResourceUnpackerOperation + + +资源解压操作类 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderOperation.cs#L429) + +Declaration +```csharp +public sealed class ResourceUnpackerOperation : DownloaderOperation, IEnumerator, IComparable + +``` + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IComparable`` +--- + +# Struct ResourceUnpackerOptions + + +资源解压的操作选项 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderOptions.cs#L124) + +Declaration +```csharp +public readonly struct ResourceUnpackerOptions + +``` + +## Properties + + +### MaximumConcurrency + + +最大并发数量 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderOptions.cs#L129) + +Declaration +```csharp +public int MaximumConcurrency { get; } + +``` + +### RetryCount + + +失败后的重试次数 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderOptions.cs#L134) + +Declaration +```csharp +public int RetryCount { get; } + +``` + +### Tags + + +资源标签列表 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/DownloaderOptions.cs#L140) + +Declaration +```csharp +public string[] Tags { get; } + +``` +--- + +# Class SceneHandle + + +场景句柄,用于管理场景的加载、激活和卸载。 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Handles/SceneHandle.cs#L8) + +Declaration +```csharp +public sealed class SceneHandle : HandleBase, IEnumerator, IDisposable + +``` + +## Properties + + +### SceneName + + +场景名称 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Handles/SceneHandle.cs#L61) + +Declaration +```csharp +public string SceneName { get; } + +``` + +### SceneObject + + +场景对象 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Handles/SceneHandle.cs#L74) + +Declaration +```csharp +public Scene SceneObject { get; } + +``` + +## Methods + + +### ActivateScene() + + +激活场景(当同时存在多个场景时用于切换激活场景) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Handles/SceneHandle.cs#L88) + +Declaration +```csharp +public bool ActivateScene() + +``` + +##### Returns + + +``System.Boolean``: 是否成功激活场景### AllowSceneActivation() +允许场景激活 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Handles/SceneHandle.cs#L108) + +Declaration +```csharp +public bool AllowSceneActivation() + +``` + +##### Returns + + +``System.Boolean``: 是否成功执行### UnloadSceneAsync() +卸载场景对象 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Handles/SceneHandle.cs#L132) + +Declaration +```csharp +public UnloadSceneOperation UnloadSceneAsync() + +``` + +##### Returns + + +[YooAsset.UnloadSceneOperation](/docs/api/YooAsset/UnloadSceneOperation): 卸载场景操作## Events + + +### Completed + + +当加载完成时触发 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Handles/SceneHandle.cs#L28) + +Declaration +```csharp +public event Action Completed + +``` + +##### Event Type + + +``System.Action`` + + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IDisposable`` +--- + +# Class SubAssetsHandle + + +子资源句柄,用于管理资源包内子资源对象的加载和访问。 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Handles/SubAssetsHandle.cs#L9) + +Declaration +```csharp +public sealed class SubAssetsHandle : HandleBase, IEnumerator, IDisposable + +``` + +## Properties + + +### SubAssetObjects + + +子资源对象集合 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Handles/SubAssetsHandle.cs#L57) + +Declaration +```csharp +public IReadOnlyList SubAssetObjects { get; } + +``` + +## Methods + + +### WaitForAsyncComplete() + + +等待异步执行完毕 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Handles/SubAssetsHandle.cs#L46) + +Declaration +```csharp +public void WaitForAsyncComplete() + +``` + +### GetSubAssetObject(string) + + +获取子资源对象 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Handles/SubAssetsHandle.cs#L73) + +Declaration +```csharp +public TObject GetSubAssetObject(string assetName) where TObject : Object + +``` + +##### Returns + + +````: 匹配的子资源对象,未找到则返回 null。 + + +##### Parameters + +TypeNameDescription``System.String``*assetName*子资源对象名称 + +##### Type Parameters + +NameDescription``TObject``子资源对象类型 + +### GetSubAssetObjects() + + +获取所有的子资源对象集合 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Handles/SubAssetsHandle.cs#L95) + +Declaration +```csharp +public IReadOnlyList GetSubAssetObjects() where TObject : Object + +``` + +##### Returns + + +``System.Collections.Generic.IReadOnlyList<>``: 匹配类型的子资源对象集合##### Type Parameters + +NameDescription``TObject``子资源对象类型 + +## Events + + +### Completed + + +当加载完成时触发 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Handles/SubAssetsHandle.cs#L24) + +Declaration +```csharp +public event Action Completed + +``` + +##### Event Type + + +``System.Action`` + + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IDisposable`` +--- + +# Delegate UnityWebRequestCreator + + +自定义 UnityWebRequest 创建委托 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/DownloadSystem/Services/UnityWebBackend/UnityWebRequestCreator.cs#L15) + +Declaration +```csharp +public delegate UnityWebRequest UnityWebRequestCreator(string url, string method) + +``` +--- + +# Class UnloadAllAssetsOperation + + +卸载所有资源的异步操作 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Operations/UnloadAllAssetsOperation.cs#L9) + +Declaration +```csharp +public sealed class UnloadAllAssetsOperation : AsyncOperationBase, IEnumerator, IComparable + +``` + +## Methods + + +### InternalStart() + + +内部启动方法(子类必须实现) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Operations/UnloadAllAssetsOperation.cs#L32) + +Declaration +```csharp +protected override void InternalStart() + +``` + +### InternalUpdate() + + +内部更新方法(子类必须实现) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Operations/UnloadAllAssetsOperation.cs#L37) + +Declaration +```csharp +protected override void InternalUpdate() + +``` + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IComparable`` +--- + +# Struct UnloadAllAssetsOptions + + +卸载所有资源的操作选项 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Operations/UnloadAllAssetsOptions.cs#L7) + +Declaration +```csharp +public readonly struct UnloadAllAssetsOptions + +``` + +## Properties + + +### ShouldReleaseHandles + + +是否释放所有资源句柄,防止卸载过程中触发完成回调。 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Operations/UnloadAllAssetsOptions.cs#L12) + +Declaration +```csharp +public bool ShouldReleaseHandles { get; } + +``` + +### ShouldLockLoading + + +是否在卸载过程中锁定加载操作,防止新的任务请求。 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Operations/UnloadAllAssetsOptions.cs#L17) + +Declaration +```csharp +public bool ShouldLockLoading { get; } + +``` +--- + +# Class UnloadSceneOperation + + +场景卸载异步操作类 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Operations/UnloadSceneOperation.cs#L9) + +Declaration +```csharp +public sealed class UnloadSceneOperation : AsyncOperationBase, IEnumerator, IComparable + +``` + +## Methods + + +### InternalStart() + + +内部启动方法(子类必须实现) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Operations/UnloadSceneOperation.cs#L46) + +Declaration +```csharp +protected override void InternalStart() + +``` + +### InternalUpdate() + + +内部更新方法(子类必须实现) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Operations/UnloadSceneOperation.cs#L51) + +Declaration +```csharp +protected override void InternalUpdate() + +``` + +### InternalGetDescription() + + +获取操作的描述信息(子类可选实现) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Operations/UnloadSceneOperation.cs#L112) + +Declaration +```csharp +protected override string InternalGetDescription() + +``` + +##### Returns + + +``System.String``: 操作的描述字符串,默认返回空字符串。 + + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IComparable`` +--- + +# Class UnloadUnusedAssetsOperation + + +卸载未使用资源的异步操作 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Operations/UnloadUnusedAssetsOperation.cs#L6) + +Declaration +```csharp +public sealed class UnloadUnusedAssetsOperation : AsyncOperationBase, IEnumerator, IComparable + +``` + +## Methods + + +### InternalStart() + + +内部启动方法(子类必须实现) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Operations/UnloadUnusedAssetsOperation.cs#L26) + +Declaration +```csharp +protected override void InternalStart() + +``` + +### InternalUpdate() + + +内部更新方法(子类必须实现) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Operations/UnloadUnusedAssetsOperation.cs#L32) + +Declaration +```csharp +protected override void InternalUpdate() + +``` + +### InternalWaitForCompletion() + + +内部同步等待方法(子类可选实现) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Operations/UnloadUnusedAssetsOperation.cs#L57) + +Declaration +```csharp +protected override void InternalWaitForCompletion() + +``` + +### InternalGetDescription() + + +获取操作的描述信息(子类可选实现) + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Operations/UnloadUnusedAssetsOperation.cs#L62) + +Declaration +```csharp +protected override string InternalGetDescription() + +``` + +##### Returns + + +``System.String``: 操作的描述字符串,默认返回空字符串。 + + +## Implements + +- ``System.Collections.IEnumerator`` + +- ``System.IComparable`` +--- + +# Struct UnloadUnusedAssetsOptions + + +卸载未使用资源的操作选项 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Operations/UnloadUnusedAssetsOptions.cs#L7) + +Declaration +```csharp +public readonly struct UnloadUnusedAssetsOptions + +``` + +## Properties + + +### MaxLoopCount + + +最大循环迭代次数 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourceManager/Operations/UnloadUnusedAssetsOptions.cs#L12) + +Declaration +```csharp +public int MaxLoopCount { get; } + +``` +--- + +# Class WebPlayModeOptions + + +WebGL运行模式的操作选项 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/InitializePackageOptions.cs#L67) + +Declaration +```csharp +public class WebPlayModeOptions : InitializePackageOptions + +``` + +## Properties + + +### WebServerFileSystemParameters + + +Web 服务器文件系统初始化参数 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/InitializePackageOptions.cs#L72) + +Declaration +```csharp +public FileSystemParameters WebServerFileSystemParameters { get; set; } + +``` + +### WebNetworkFileSystemParameters + + +Web 网络文件系统初始化参数 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/ResourcePackage/Operations/InitializePackageOptions.cs#L77) + +Declaration +```csharp +public FileSystemParameters WebNetworkFileSystemParameters { get; set; } + +``` +--- + +# Class YooAssetConfiguration + + +提供 YooAsset 全局配置的访问入口 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Settings/YooAssetConfiguration.cs#L10) + +Declaration +```csharp +public static class YooAssetConfiguration + +``` + +## Methods + + +### GetYooFolderName() + + +获取资源包裹的根文件夹名称 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Settings/YooAssetConfiguration.cs#L55) + +Declaration +```csharp +public static string GetYooFolderName() + +``` + +##### Returns + + +``System.String``: 文件夹名称。如果未配置则返回默认值 "yoo"。### GetBuildReportFileName(string, string) +获取构建报告的文件名 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Settings/YooAssetConfiguration.cs#L66) + +Declaration +```csharp +public static string GetBuildReportFileName(string packageName, string packageVersion) + +``` + +##### Returns + + +``System.String``: 包含 .report 扩展名的文件名 + + +##### Parameters + +TypeNameDescription``System.String``*packageName*包裹名称``System.String``*packageVersion*包裹版本号 + +### GetManifestBinaryFileName(string, string) + + +获取清单二进制文件的文件名 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Settings/YooAssetConfiguration.cs#L86) + +Declaration +```csharp +public static string GetManifestBinaryFileName(string packageName, string packageVersion) + +``` + +##### Returns + + +``System.String``: 包含 .bytes 扩展名的文件名 + + +##### Parameters + +TypeNameDescription``System.String``*packageName*包裹名称``System.String``*packageVersion*包裹版本号 + +### GetManifestJsonFileName(string, string) + + +获取清单 JSON 文件的文件名 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Settings/YooAssetConfiguration.cs#L106) + +Declaration +```csharp +public static string GetManifestJsonFileName(string packageName, string packageVersion) + +``` + +##### Returns + + +``System.String``: 包含 .json 扩展名的文件名 + + +##### Parameters + +TypeNameDescription``System.String``*packageName*包裹名称``System.String``*packageVersion*包裹版本号 + +### GetPackageHashFileName(string, string) + + +获取包裹的哈希校验文件名 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Settings/YooAssetConfiguration.cs#L126) + +Declaration +```csharp +public static string GetPackageHashFileName(string packageName, string packageVersion) + +``` + +##### Returns + + +``System.String``: 包含 .hash 扩展名的文件名 + + +##### Parameters + +TypeNameDescription``System.String``*packageName*包裹名称``System.String``*packageVersion*包裹版本号 + +### GetPackageVersionFileName(string) + + +获取包裹的版本记录文件名 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Settings/YooAssetConfiguration.cs#L145) + +Declaration +```csharp +public static string GetPackageVersionFileName(string packageName) + +``` + +##### Returns + + +``System.String``: 包含 .version 扩展名的文件名 + + +##### Parameters + +TypeNameDescription``System.String``*packageName*包裹名称 +--- + +# Class YooAssets + + +资源系统的主入口 + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/YooAssets.cs#L13) + +Declaration +```csharp +public static class YooAssets + +``` + +## Properties + + +### IsInitialized + + +是否已经初始化 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/YooAssets.cs#L32) + +Declaration +```csharp +public static bool IsInitialized { get; } + +``` + +## Methods + + +### Initialize() + + +初始化资源系统 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/YooAssets.cs#L40) + +Declaration +```csharp +public static void Initialize() + +``` + +### Initialize(ILogger) + + +初始化资源系统 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/YooAssets.cs#L49) + +Declaration +```csharp +public static void Initialize(ILogger logger) + +``` + +##### Parameters + +TypeNameDescription[YooAsset.ILogger](/docs/api/YooAsset/ILogger)*logger*自定义日志处理 + +### Destroy() + + +销毁资源系统 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/YooAssets.cs#L75) + +Declaration +```csharp +public static void Destroy() + +``` + +### CreatePackage(string) + + +创建资源包裹 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/YooAssets.cs#L116) + +Declaration +```csharp +public static ResourcePackage CreatePackage(string packageName) + +``` + +##### Returns + + +[YooAsset.ResourcePackage](/docs/api/YooAsset/ResourcePackage): 新创建的资源包裹实例 + + +##### Parameters + +TypeNameDescription``System.String``*packageName*包裹名称 + +### CreatePackage(string, uint) + + +创建资源包裹 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/YooAssets.cs#L127) + +Declaration +```csharp +public static ResourcePackage CreatePackage(string packageName, uint packagePriority) + +``` + +##### Returns + + +[YooAsset.ResourcePackage](/docs/api/YooAsset/ResourcePackage): 新创建的资源包裹实例 + + +##### Parameters + +TypeNameDescription``System.String``*packageName*包裹名称``System.UInt32``*packagePriority*包裹优先级(值越大越优先更新) + +### GetPackage(string) + + +获取资源包裹 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/YooAssets.cs#L147) + +Declaration +```csharp +public static ResourcePackage GetPackage(string packageName) + +``` + +##### Returns + + +[YooAsset.ResourcePackage](/docs/api/YooAsset/ResourcePackage): 指定名称的资源包裹实例 + + +##### Parameters + +TypeNameDescription``System.String``*packageName*包裹名称 + +### TryGetPackage(string, out ResourcePackage) + + +尝试获取资源包裹 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/YooAssets.cs#L162) + +Declaration +```csharp +public static bool TryGetPackage(string packageName, out ResourcePackage package) + +``` + +##### Returns + + +``System.Boolean``: 如果资源包裹存在返回true,否则返回false。 + + +##### Parameters + +TypeNameDescription``System.String``*packageName*包裹名称[YooAsset.ResourcePackage](/docs/api/YooAsset/ResourcePackage)*package*获取到的资源包裹,如果不存在则为null。 + +### GetPackages() + + +获取所有资源包裹 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/YooAssets.cs#L173) + +Declaration +```csharp +public static IReadOnlyList GetPackages() + +``` + +##### Returns + + +``System.Collections.Generic.IReadOnlyList``: 当前已注册的所有资源包裹的只读列表### RemovePackage(string) +移除资源包裹 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/YooAssets.cs#L183) + +Declaration +```csharp +public static void RemovePackage(string packageName) + +``` + +##### Parameters + +TypeNameDescription``System.String``*packageName*包裹名称 + +### ContainsPackage(string) + + +检测资源包裹是否存在 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/YooAssets.cs#L203) + +Declaration +```csharp +public static bool ContainsPackage(string packageName) + +``` + +##### Returns + + +``System.Boolean``: 如果资源包裹存在返回true,否则返回false。 + + +##### Parameters + +TypeNameDescription``System.String``*packageName*包裹名称 + +### SetAsyncOperationMaxTimeSlice(long) + + +设置异步系统参数,每帧执行消耗的最大时间切片。 + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/YooAssets.cs#L214) + +Declaration +```csharp +public static void SetAsyncOperationMaxTimeSlice(long milliseconds) + +``` + +##### Parameters + +TypeNameDescription``System.Int64``*milliseconds*最大时间切片(单位:毫秒),不能为负数。 +--- + +# Class YooException + + +Base exception for all YooAsset custom exceptions. + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Utility/YooException.cs#L11) + +Declaration +```csharp +[Serializable] +public class YooException : Exception, ISerializable + +``` + +## Implements + +- ``System.Runtime.Serialization.ISerializable`` +--- + +# Class YooHandleInvalidException + + +The exception that is thrown when a resource handle is invalid. + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Utility/YooException.cs#L89) + +Declaration +```csharp +[Serializable] +public class YooHandleInvalidException : YooException, ISerializable + +``` + +## Implements + +- ``System.Runtime.Serialization.ISerializable`` +--- + +# Class YooInternalException + + +The exception that is thrown when an internal logic error occurs in YooAsset. + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Utility/YooException.cs#L31) + +Declaration +```csharp +[Serializable] +public class YooInternalException : YooException, ISerializable + +``` + +## Implements + +- ``System.Runtime.Serialization.ISerializable`` +--- + +# Class YooManifestInvalidException + + +The exception that is thrown when the resource manifest data is invalid. + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Utility/YooException.cs#L75) + +Declaration +```csharp +[Serializable] +public class YooManifestInvalidException : YooException, ISerializable + +``` + +## Implements + +- ``System.Runtime.Serialization.ISerializable`` +--- + +# Class YooPackageInvalidException + + +The exception that is thrown when a resource package is in an invalid state. + + +###### **Assembly**: YooAsset.dll + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Utility/YooException.cs#L47) + +Declaration +```csharp +[Serializable] +public class YooPackageInvalidException : YooException, ISerializable + +``` + +## Properties + + +### PackageName + + +Gets the name of the package that caused the exception. + + +###### [View Source](https://github.com/tuyoogame/YooAsset/blob/yoo3/Assets/YooAsset/Runtime/Utility/YooException.cs#L53) + +Declaration +```csharp +public string PackageName { get; } + +``` + +## Implements + +- ``System.Runtime.Serialization.ISerializable``