Files
Other/YooAsset_API/YooAsset_API_Reference_3.0.md

194 KiB
Raw Blame History

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

Declaration

public sealed class AllAssetsHandle : HandleBase, IEnumerator, IDisposable

Properties

AllAssetObjects

所有资源对象集合

View Source

Declaration

public IReadOnlyList<Object> AllAssetObjects { get; }

Methods

WaitForAsyncComplete()

等待异步执行完毕

View Source

Declaration

public void WaitForAsyncComplete()

Events

Completed

当加载完成时触发

View Source

Declaration

public event Action<AllAssetsHandle> Completed

Event Type

System.Action<YooAsset.AllAssetsHandle>

Implements

  • System.Collections.IEnumerator

  • System.IDisposable


Class AssetHandle

资源句柄,用于管理单个资源对象的加载和访问。

Assembly: YooAsset.dll
View Source

Declaration

public sealed class AssetHandle : HandleBase, IEnumerator, IDisposable

Properties

AssetObject

资源对象

View Source

Declaration

public Object AssetObject { get; }

Methods

WaitForAsyncComplete()

等待异步执行完毕

View Source

Declaration

public void WaitForAsyncComplete()

GetAssetObject()

获取资源对象

View Source

Declaration

public TAsset GetAssetObject<TAsset>() where TAsset : Object

Returns

<TAsset>: 资源对象,如果句柄无效则返回 null。##### Type Parameters

NameDescriptionTAsset资源类型

InstantiateSync()

同步实例化游戏对象

View Source

Declaration

public GameObject InstantiateSync()

Returns

UnityEngine.GameObject: 实例化的游戏对象### InstantiateSync(InstantiateOptions) 同步实例化游戏对象

View Source

Declaration

public GameObject InstantiateSync(InstantiateOptions options)

Returns

UnityEngine.GameObject: 实例化的游戏对象

Parameters

TypeNameDescriptionYooAsset.InstantiateOptionsoptions实例化选项

InstantiateAsync()

实例化游戏对象

View Source

Declaration

public InstantiateOperation InstantiateAsync()

Returns

YooAsset.InstantiateOperation: 实例化操作### InstantiateAsync(InstantiateOptions) 实例化游戏对象

View Source

Declaration

public InstantiateOperation InstantiateAsync(InstantiateOptions options)

Returns

YooAsset.InstantiateOperation: 实例化操作

Parameters

TypeNameDescriptionYooAsset.InstantiateOptionsoptions实例化选项

Events

Completed

当加载完成时触发

View Source

Declaration

public event Action<AssetHandle> Completed

Event Type

System.Action<YooAsset.AssetHandle>

Implements

  • System.Collections.IEnumerator

  • System.IDisposable


Class AssetInfo

资源信息类

Assembly: YooAsset.dll
View Source

Declaration

public class AssetInfo

Properties

PackageName

所属包裹

View Source

Declaration

public string PackageName { get; }

AssetType

资源类型

View Source

Declaration

public Type AssetType { get; }

Error

错误信息

View Source

Declaration

public string Error { get; }

IsValid

资源信息是否有效

View Source

Declaration

public bool IsValid { get; }

Address

可寻址地址

View Source

Declaration

public string Address { get; }

AssetPath

资源路径

View Source

Declaration

public string AssetPath { get; }


Class AsyncOperationBase

异步操作基类

Assembly: YooAsset.dll
View Source

Declaration

public abstract class AsyncOperationBase : IEnumerator, IComparable<AsyncOperationBase>

Properties

IsBusy

当前帧时间切片是否已用完

View Source

Declaration

protected bool IsBusy { get; }

Priority

任务优先级(值越大越优先执行)

View Source

Declaration

public uint Priority { get; set; }

Progress

异步操作的处理进度0f - 1f

View Source

Declaration

public float Progress { get; protected set; }

IsDone

异步操作是否已结束

View Source

Declaration

public bool IsDone { get; }

Error

操作失败时的错误描述

View Source

Declaration

public string Error { get; }

Status

异步操作的当前状态

View Source

Declaration

public EOperationStatus Status { get; }

Methods

WaitForCompletion()

同步等待异步执行完毕

View Source

Declaration

public void WaitForCompletion()

InternalStart()

内部启动方法(子类必须实现)

View Source

Declaration

protected abstract void InternalStart()

InternalUpdate()

内部更新方法(子类必须实现)

View Source

Declaration

protected abstract void InternalUpdate()

InternalAbort()

内部中止方法(子类可选实现)

View Source

Declaration

protected virtual void InternalAbort()

InternalDispose()

内部释放方法(子类可选实现)

View Source

Declaration

protected virtual void InternalDispose()

InternalGetDescription()

获取操作的描述信息(子类可选实现)

View Source

Declaration

protected virtual string InternalGetDescription()

Returns

System.String: 操作的描述字符串,默认返回空字符串。### InternalWaitForCompletion() 内部同步等待方法(子类可选实现)

View Source

Declaration

protected virtual void InternalWaitForCompletion()

SetResult()

将操作标记为成功完成

View Source

Declaration

protected void SetResult()

SetError(string)

将操作标记为失败

View Source

Declaration

protected void SetError(string error)

Parameters

TypeNameDescriptionSystem.Stringerror错误描述

CalculateMultiStageProgress(int, int, int, int)

计算多阶段操作的整体进度

View Source

Declaration

protected float CalculateMultiStageProgress(int stageIndex, int stageCount, int remaining, int total)

Returns

System.Single: 返回归一化的整体进度值0-1

Parameters

TypeNameDescriptionSystem.Int32stageIndex当前阶段索引从0开始System.Int32stageCount阶段总数System.Int32remaining当前阶段剩余工作量System.Int32total当前阶段总工作量

AddChildOperation(AsyncOperationBase)

添加子任务

View Source

Declaration

protected void AddChildOperation(AsyncOperationBase child)

Parameters

TypeNameDescriptionYooAsset.AsyncOperationBasechild要添加的子任务

RemoveChildOperation(AsyncOperationBase)

移除子任务

View Source

Declaration

protected void RemoveChildOperation(AsyncOperationBase child)

Parameters

TypeNameDescriptionYooAsset.AsyncOperationBasechild要移除的子任务

ExecuteOnce()

执行一次更新逻辑

View Source

Declaration

protected void ExecuteOnce()

ExecuteBatch(int)

批量执行一定次数的更新逻辑

View Source

Declaration

protected void ExecuteBatch(int count = 1000)

Parameters

TypeNameDescriptionSystem.Int32count最大执行次数默认1000次。

ExecuteUntilComplete(int)

循环执行更新逻辑直到操作完成

View Source

Declaration

protected void ExecuteUntilComplete(int sleepMilliseconds = 1)

Parameters

TypeNameDescriptionSystem.Int32sleepMilliseconds每次循环后的休眠时长(毫秒)

CompareTo(AsyncOperationBase)

View Source

Declaration

public int CompareTo(AsyncOperationBase other)

Returns

System.Int32

Parameters

TypeNameYooAsset.AsyncOperationBaseother

GetAwaiter()

获取用于 async/await 的等待器

View Source

Declaration

public OperationAwaiter GetAwaiter()

Returns

YooAsset.OperationAwaiter: 当前操作的等待器## Events

Completed

异步操作的完成事件

View Source

Declaration

public event Action<AsyncOperationBase> Completed

Event Type

System.Action<YooAsset.AsyncOperationBase>

Implements

  • System.Collections.IEnumerator

  • System.IComparable<YooAsset.AsyncOperationBase>


Struct BundleDecryptArgs

资源包解密操作的输入参数

Assembly: YooAsset.dll
View Source

Declaration

public readonly struct BundleDecryptArgs

Properties

FileData

资源包的二进制数据

View Source

Declaration

public byte[] FileData { get; }

FilePath

资源包的文件路径

View Source

Declaration

public string FilePath { get; }


Struct BundleDownloaderOptions

按资源信息创建下载器的操作选项

Assembly: YooAsset.dll
View Source

Declaration

public readonly struct BundleDownloaderOptions

Properties

MaximumConcurrency

最大并发数量

View Source

Declaration

public int MaximumConcurrency { get; }

RetryCount

失败后的重试次数

View Source

Declaration

public int RetryCount { get; }

DownloadBundleDependencies

下载资源对象所属资源包内所有资源对象依赖的资源包

View Source

Declaration

public bool DownloadBundleDependencies { get; }

AssetInfos

资源信息列表

View Source

Declaration

public AssetInfo[] AssetInfos { get; }


Struct BundleEncryptArgs

资源包加密操作的输入参数

Assembly: YooAsset.dll
View Source

Declaration

public readonly struct BundleEncryptArgs

Properties

FilePath

待加密的源文件路径

View Source

Declaration

public string FilePath { get; }


Struct BundleEncryptResult

资源包加密操作的返回结果

Assembly: YooAsset.dll
View Source

Declaration

public readonly struct BundleEncryptResult

Properties

IsEncrypted

文件是否已加密

View Source

Declaration

public bool IsEncrypted { get; }

EncryptedFileData

加密后的文件数据

View Source

Declaration

public byte[] EncryptedFileData { get; }


Class BundleFileHandle

资源包文件句柄,用于持有已加载的资源包引用。

Assembly: YooAsset.dll
View Source

Declaration

public sealed class BundleFileHandle : HandleBase, IEnumerator, IDisposable

Methods

WaitForAsyncComplete()

等待异步执行完毕

View Source

Declaration

public void WaitForAsyncComplete()

Events

Completed

当加载完成时触发

View Source

Declaration

public event Action<BundleFileHandle> Completed

Event Type

System.Action<YooAsset.BundleFileHandle>

Implements

  • System.Collections.IEnumerator

  • System.IDisposable


Struct BundleImporterOptions

资源导入的操作选项

Assembly: YooAsset.dll
View Source

Declaration

public readonly struct BundleImporterOptions

Properties

MaximumConcurrency

最大并发数量

View Source

Declaration

public int MaximumConcurrency { get; }

RetryCount

失败后的重试次数

View Source

Declaration

public int RetryCount { get; }

BundleInfos

资源包信息列表

View Source

Declaration

public ImportBundleInfo[] BundleInfos { get; }


Struct BundleUnpackInfo

资源包解包判定信息

Assembly: YooAsset.dll
View Source

Declaration

public readonly struct BundleUnpackInfo

Properties

BundleName

资源包名称

View Source

Declaration

public string BundleName { get; }

FileName

资源包文件名称

View Source

Declaration

public string FileName { get; }

BundleType

资源包类型

View Source

Declaration

public int BundleType { get; }

IsEncrypted

是否为加密资源包

View Source

Declaration

public bool IsEncrypted { get; }

TagCount

分类标签数量

View Source

Declaration

public int TagCount { get; }

Methods

GetTag(int)

获取指定索引的分类标签

View Source

Declaration

public string GetTag(int index)

Returns

System.String

Parameters

TypeNameSystem.Int32index

HasTag(string)

是否包含指定的单个标签

View Source

Declaration

public bool HasTag(string tag)

Returns

System.Boolean

Parameters

TypeNameSystem.Stringtag

HasAnyTag(string[])

是否包含指定标签数组中的任意一个

View Source

Declaration

public bool HasAnyTag(string[] tags)

Returns

System.Boolean

Parameters

TypeNameSystem.String[]tags

Class ClearCacheMethods

缓存清理方式标识符

Assembly: YooAsset.dll
View Source

Declaration

public static class ClearCacheMethods

Fields

ClearAllBundleFiles

清理所有资源包文件

View Source

Declaration

public const string ClearAllBundleFiles = "ClearAllBundleFiles"

ClearUnusedBundleFiles

清理未在使用的资源包文件

View Source

Declaration

public const string ClearUnusedBundleFiles = "ClearUnusedBundleFiles"

ClearBundleFilesByLocations

清理指定地址的资源包文件

View Source

Declaration

public const string ClearBundleFilesByLocations = "ClearBundleFilesByLocations"

ClearBundleFilesByTags

清理指定标签的资源包文件

View Source

Declaration

public const string ClearBundleFilesByTags = "ClearBundleFilesByTags"

ClearAllManifestFiles

清理所有清单文件

View Source

Declaration

public const string ClearAllManifestFiles = "ClearAllManifestFiles"

ClearUnusedManifestFiles

清理未在使用的清单文件

View Source

Declaration

public const string ClearUnusedManifestFiles = "ClearUnusedManifestFiles"


Class ClearCacheOperation

清理缓存操作

Assembly: YooAsset.dll
View Source

Declaration

public sealed class ClearCacheOperation : AsyncOperationBase, IEnumerator, IComparable<AsyncOperationBase>

Methods

InternalStart()

内部启动方法(子类必须实现)

View Source

Declaration

protected override void InternalStart()

InternalUpdate()

内部更新方法(子类必须实现)

View Source

Declaration

protected override void InternalUpdate()

InternalGetDescription()

获取操作的描述信息(子类可选实现)

View Source

Declaration

protected override string InternalGetDescription()

Returns

System.String: 操作的描述字符串,默认返回空字符串。

Implements

  • System.Collections.IEnumerator

  • System.IComparable<YooAsset.AsyncOperationBase>


Struct ClearCacheOptions

清理缓存的操作选项

Assembly: YooAsset.dll
View Source

Declaration

public readonly struct ClearCacheOptions

Properties

ClearMethod

清理方式

View Source

Declaration

public string ClearMethod { get; }

ClearParameter

附加参数

View Source

Declaration

public object ClearParameter { get; }


Class CustomPlayModeOptions

自定义运行模式的操作选项

Assembly: YooAsset.dll
View Source

Declaration

public class CustomPlayModeOptions : InitializePackageOptions

Fields

FileSystemParameterList

文件系统初始化参数列表

View Source

Declaration

public readonly List<FileSystemParameters> FileSystemParameterList


Class DefaultDownloadRetryPolicy

默认的下载重试策略

Assembly: YooAsset.dll
View Source

Declaration

public class DefaultDownloadRetryPolicy : IDownloadRetryPolicy

Methods

IsRetryableError(string, long, string)

判断本次下载失败是否属于可重试的错误

View Source

Declaration

public bool IsRetryableError(string url, long httpCode, string httpError)

Returns

System.Boolean: 如果该错误可以重试则返回 true否则返回 false。

Parameters

TypeNameDescriptionSystem.Stringurl失败请求的 URLSystem.Int64httpCodeHTTP 响应状态码System.StringhttpErrorHTTP 错误信息

CalculateRetryDelay(int, float)

计算重试等待时长(秒)

View Source

Declaration

public float CalculateRetryDelay(int retryCount, float previousDelay)

Returns

System.Single: 本次重试前的等待时长(秒)

Parameters

TypeNameDescriptionSystem.Int32retryCount当前已重试次数System.SinglepreviousDelay上一次的等待时长(秒)

Implements


Class DefaultDownloadUrlPolicy

默认的 URL 选择策略

Assembly: YooAsset.dll
View Source

Declaration

public class DefaultDownloadUrlPolicy : IDownloadUrlPolicy

Methods

SelectUrl(IReadOnlyList)

基于内部失败计数轮转选择 URL

View Source

Declaration

public string SelectUrl(IReadOnlyList<string> candidateUrls)

Returns

System.String: 选中的 URL

Parameters

TypeNameDescriptionSystem.Collections.Generic.IReadOnlyList<System.String>candidateUrls候选 URL 列表

OnRequestSucceeded(string)

请求成功反馈,保持当前 URL 不变。

View Source

Declaration

public void OnRequestSucceeded(string url)

Parameters

TypeNameDescriptionSystem.Stringurl成功请求的 URL

OnRequestFailed(string, long, string)

请求失败反馈,递增失败计数以切换 URL。

View Source

Declaration

public void OnRequestFailed(string url, long httpCode, string httpError)

Parameters

TypeNameDescriptionSystem.Stringurl失败请求的 URLSystem.Int64httpCodeHTTP 响应状态码System.StringhttpErrorHTTP 错误信息

Implements


Class DestroyPackageOperation

销毁资源包裹操作

Assembly: YooAsset.dll
View Source

Declaration

public sealed class DestroyPackageOperation : AsyncOperationBase, IEnumerator, IComparable<AsyncOperationBase>

Methods

InternalStart()

内部启动方法(子类必须实现)

View Source

Declaration

protected override void InternalStart()

InternalUpdate()

内部更新方法(子类必须实现)

View Source

Declaration

protected override void InternalUpdate()

InternalGetDescription()

获取操作的描述信息(子类可选实现)

View Source

Declaration

protected override string InternalGetDescription()

Returns

System.String: 操作的描述字符串,默认返回空字符串。

Implements

  • System.Collections.IEnumerator

  • System.IComparable<YooAsset.AsyncOperationBase>


Struct DownloadCompletedEventArgs

下载完成事件参数

Assembly: YooAsset.dll
View Source

Declaration

public readonly struct DownloadCompletedEventArgs

Properties

PackageName

所属包裹名称

View Source

Declaration

public string PackageName { get; }

Succeeded

是否成功

View Source

Declaration

public bool Succeeded { get; }

Error

下载失败时的错误信息

View Source

Declaration

public string Error { get; }


Class DownloaderOperation

下载操作基类,提供资源下载、暂停、恢复和取消功能。

Assembly: YooAsset.dll
View Source

Declaration

public abstract class DownloaderOperation : AsyncOperationBase, IEnumerator, IComparable<AsyncOperationBase>

Properties

TotalDownloadCount

统计的下载文件总数量

View Source

Declaration

public int TotalDownloadCount { get; }

TotalDownloadBytes

统计的下载文件的总大小

View Source

Declaration

public long TotalDownloadBytes { get; }

CurrentDownloadCount

当前已经完成的下载总数量

View Source

Declaration

public int CurrentDownloadCount { get; }

CurrentDownloadBytes

当前已经完成的下载总大小

View Source

Declaration

public long CurrentDownloadBytes { get; }

Methods

InternalStart()

内部启动方法(子类必须实现)

View Source

Declaration

protected override void InternalStart()

InternalUpdate()

内部更新方法(子类必须实现)

View Source

Declaration

protected override void InternalUpdate()

Combine(DownloaderOperation)

合并其它下载器

View Source

Declaration

public void Combine(DownloaderOperation downloader)

Parameters

TypeNameDescriptionYooAsset.DownloaderOperationdownloader合并的下载器

StartDownload()

开始下载

View Source

Declaration

public void StartDownload()

PauseDownload()

暂停下载

View Source

Declaration

public void PauseDownload()

ResumeDownload()

恢复下载

View Source

Declaration

public void ResumeDownload()

CancelDownload()

取消下载

View Source

Declaration

public void CancelDownload()

Events

DownloadCompleted

当下载完成时触发(无论成功或失败)。

View Source

Declaration

public event Action<DownloadCompletedEventArgs> DownloadCompleted

Event Type

System.Action<YooAsset.DownloadCompletedEventArgs>

DownloadProgressChanged

当下载进度更新时触发

View Source

Declaration

public event Action<DownloadProgressChangedEventArgs> DownloadProgressChanged

Event Type

System.Action<YooAsset.DownloadProgressChangedEventArgs>

DownloadError

当发生下载错误时触发

View Source

Declaration

public event Action<DownloadErrorEventArgs> DownloadError

Event Type

System.Action<YooAsset.DownloadErrorEventArgs>

DownloadFileStarted

当开始下载单个文件时触发

View Source

Declaration

public event Action<DownloadFileStartedEventArgs> DownloadFileStarted

Event Type

System.Action<YooAsset.DownloadFileStartedEventArgs>

Implements

  • System.Collections.IEnumerator

  • System.IComparable<YooAsset.AsyncOperationBase>


Struct DownloadErrorEventArgs

下载错误事件参数

Assembly: YooAsset.dll
View Source

Declaration

public readonly struct DownloadErrorEventArgs

Properties

PackageName

所属包裹名称

View Source

Declaration

public string PackageName { get; }

FileName

下载失败的文件名称

View Source

Declaration

public string FileName { get; }

ErrorInfo

错误信息

View Source

Declaration

public string ErrorInfo { get; }


Struct DownloadFileStartedEventArgs

开始下载单个文件事件参数

Assembly: YooAsset.dll
View Source

Declaration

public readonly struct DownloadFileStartedEventArgs

Properties

PackageName

所属包裹名称

View Source

Declaration

public string PackageName { get; }

BundleName

资源包名称

View Source

Declaration

public string BundleName { get; }

FileName

文件名称

View Source

Declaration

public string FileName { get; }

FileSize

文件大小

View Source

Declaration

public long FileSize { get; }


Struct DownloadProgressChangedEventArgs

下载进度更新事件参数

Assembly: YooAsset.dll
View Source

Declaration

public readonly struct DownloadProgressChangedEventArgs

Properties

PackageName

所属包裹名称

View Source

Declaration

public string PackageName { get; }

Progress

下载进度 (0-1f)

View Source

Declaration

public float Progress { get; }

TotalDownloadCount

下载文件总数

View Source

Declaration

public int TotalDownloadCount { get; }

TotalDownloadBytes

下载数据总大小(单位:字节)

View Source

Declaration

public long TotalDownloadBytes { get; }

CurrentDownloadCount

当前完成的下载文件数量

View Source

Declaration

public int CurrentDownloadCount { get; }

CurrentDownloadBytes

当前完成的下载数据大小(单位:字节)

View Source

Declaration

public long CurrentDownloadBytes { get; }


Struct DownloadReport

下载状态报告

Assembly: YooAsset.dll
View Source

Declaration

public readonly struct DownloadReport

Properties

HttpCode

HTTP 响应状态码

View Source

Declaration

public long HttpCode { get; }

HttpError

HTTP 错误信息

View Source

Declaration

public string HttpError { get; }

DownloadedBytes

当前下载的字节数

View Source

Declaration

public long DownloadedBytes { get; }

DownloadProgress

当前下载进度0f - 1f

View Source

Declaration

public float DownloadProgress { get; }

Fields

Empty

空的下载报告实例(所有字段为默认值)

View Source

Declaration

public static readonly DownloadReport Empty

Methods

CreateProgress(long, float)

创建下载进度报告

View Source

Declaration

public static DownloadReport CreateProgress(long downloadedBytes, float downloadProgress)

Returns

YooAsset.DownloadReport: 不含 HTTP 状态信息的进度报告

Parameters

TypeNameDescriptionSystem.Int64downloadedBytes已下载的字节数System.SingledownloadProgress下载进度,取值范围 0f ~ 1f

CreateFinished(long, string, long, float)

创建包含 HTTP 状态的最终报告(成功或失败)

View Source

Declaration

public static DownloadReport CreateFinished(long httpCode, string httpError, long downloadedBytes, float downloadProgress)

Returns

YooAsset.DownloadReport: 包含完整 HTTP 状态信息的最终报告

Parameters

TypeNameDescriptionSystem.Int64httpCodeHTTP 响应状态码System.StringhttpErrorHTTP 错误信息,成功时为 null。System.Int64downloadedBytes已下载的字节数System.SingledownloadProgress下载进度,取值范围 0f ~ 1f

Enum EBundleType

资源包的类型

Assembly: YooAsset.dll
View Source

Declaration

public enum EBundleType

Fields

None

未指定类型

View Source

Declaration

None = 0

AssetBundle

Unity引擎资源包

View Source

Declaration

AssetBundle = 2

RawBundle

原生文件资源包

View Source

Declaration

RawBundle = 3

ArchiveBundle

归档文件资源包

View Source

Declaration

ArchiveBundle = 4

InstantBundle

团结引擎资源包

View Source

Declaration

InstantBundle = 5

VirtualAssetBundle

虚拟 Unity 引擎资源包(编辑器模拟 AssetBundle

View Source

Declaration

VirtualAssetBundle = 12

VirtualRawBundle

虚拟原生文件资源包(编辑器模拟 RawBundle

View Source

Declaration

VirtualRawBundle = 13

VirtualArchiveBundle

虚拟归档文件资源包(编辑器模拟 ArchiveBundle

View Source

Declaration

VirtualArchiveBundle = 14


Class EditorSimulateBuildInvoker

编辑器模拟构建的调用入口

Assembly: YooAsset.dll
View Source

Declaration

public static class EditorSimulateBuildInvoker

Methods

Build(string, int)

执行编辑器模拟构建

View Source

Declaration

public static PackageBuildResult Build(string packageName, int buildBundleType)

Returns

YooAsset.PackageBuildResult: 构建结果

Parameters

TypeNameDescriptionSystem.StringpackageName包裹名称System.Int32buildBundleType构建资源包类型

Class EditorSimulateModeOptions

编辑器下模拟运行模式的操作选项

Assembly: YooAsset.dll
View Source

Declaration

public class EditorSimulateModeOptions : InitializePackageOptions

Properties

EditorFileSystemParameters

编辑器文件系统初始化参数

View Source

Declaration

public FileSystemParameters EditorFileSystemParameters { get; set; }


Enum EFileNameStyle

远端资源文件命名风格

Assembly: YooAsset.dll
View Source

Declaration

public enum EFileNameStyle

Fields

HashName

哈希值名称

View Source

Declaration

HashName = 0

BundleName

资源包名称(不推荐)

View Source

Declaration

BundleName = 1

BundleName_HashName

资源包名称 + 哈希值名称

View Source

Declaration

BundleName_HashName = 2


Enum EFileSystemParameter

文件系统参数类型定义

Assembly: YooAsset.dll
View Source

Declaration

public enum EFileSystemParameter

Fields

FileVerifyLevel

初始化的时候缓存文件校验级别 YooAsset.EFileVerifyLevel

View Source

Declaration

FileVerifyLevel = 0

FileVerifyMaxConcurrency

初始化的时候缓存文件校验最大并发数 System.Int32

View Source

Declaration

FileVerifyMaxConcurrency = 1

InstallCleanupMode

覆盖安装缓存清理模式 YooAsset.EInstallCleanupMode

View Source

Declaration

InstallCleanupMode = 2

DisableUnityWebCache

禁用Unity的网络缓存 System.Boolean

View Source

Declaration

DisableUnityWebCache = 3

UnityWebRequestCreator

UnityWebRequest 创建委托 YooAsset.EFileSystemParameter.UnityWebRequestCreator

View Source

Declaration

UnityWebRequestCreator = 4

DownloadDisableOndemand

禁用边玩边下机制 System.Boolean

View Source

Declaration

DownloadDisableOndemand = 5

DownloadBackend

下载后台接口 YooAsset.IDownloadBackend

View Source

Declaration

DownloadBackend = 6

DownloadMaxConcurrency

最大并发连接数 默认值10推荐范围 1-32 System.Int32

View Source

Declaration

DownloadMaxConcurrency = 7

DownloadMaxRequestPerFrame

每帧发起的最大请求数 默认值5推荐范围 1-10System.Int32

View Source

Declaration

DownloadMaxRequestPerFrame = 8

DownloadWatchdogTimeout

下载任务的看门狗机制超时时间 System.Int32

View Source

Declaration

DownloadWatchdogTimeout = 9

DownloadResumeMinimumSize

启用断点续传的最小尺寸 System.Int64

View Source

Declaration

DownloadResumeMinimumSize = 10

VirtualWebglMode

模拟WebGL平台模式 System.Boolean

View Source

Declaration

VirtualWebglMode = 11

VirtualDownloadMode

模拟虚拟下载模式 System.Boolean

View Source

Declaration

VirtualDownloadMode = 12

VirtualDownloadSpeed

模拟虚拟下载的网速(单位:字节) System.Int32

View Source

Declaration

VirtualDownloadSpeed = 13

AsyncSimulateMinFrame

异步模拟加载最小帧数 System.Int32

View Source

Declaration

AsyncSimulateMinFrame = 14

AsyncSimulateMaxFrame

异步模拟加载最大帧数 System.Int32

View Source

Declaration

AsyncSimulateMaxFrame = 15

CopyBuiltinPackageManifest

拷贝内置清单 System.Boolean

View Source

Declaration

CopyBuiltinPackageManifest = 16

CopyBuiltinPackageManifestDestRoot

拷贝内置清单的目标目录 System.String

View Source

Declaration

CopyBuiltinPackageManifestDestRoot = 17

UnpackFileSystemRoot

解压文件系统的根目录 System.String

View Source

Declaration

UnpackFileSystemRoot = 18

RemoteService

远端资源地址查询服务类 YooAsset.IRemoteService

View Source

Declaration

RemoteService = 19

AssetBundleDecryptor

AssetBundle 解密器 YooAsset.IBundleDecryptor

View Source

Declaration

AssetBundleDecryptor = 20

RawBundleDecryptor

RawBundle 解密器 YooAsset.IBundleDecryptor

View Source

Declaration

RawBundleDecryptor = 21

ArchiveBundleDecryptor

ArchiveBundle 解密器 YooAsset.IBundleDecryptor

View Source

Declaration

ArchiveBundleDecryptor = 22

AssetBundleFallbackDecryptor

AssetBundle 备用解密器 YooAsset.IBundleMemoryDecryptor

View Source

Declaration

AssetBundleFallbackDecryptor = 23

ManifestDecryptor

资源清单解密器 YooAsset.IManifestDecryptor

View Source

Declaration

ManifestDecryptor = 24

DownloadRetryPolicy

下载重试判定策略 YooAsset.IDownloadRetryPolicy

View Source

Declaration

DownloadRetryPolicy = 25

DownloadUrlPolicy

URL 选择策略 YooAsset.IDownloadUrlPolicy

View Source

Declaration

DownloadUrlPolicy = 26

WebPlatformStrategy

WebGL 平台策略 YooAsset.IWebPlatformStrategy

View Source

Declaration

WebPlatformStrategy = 27

BundleUnpackPolicy

内置资源包解包策略 YooAsset.IBundleUnpackPolicy

View Source

Declaration

BundleUnpackPolicy = 28

BuiltinFileAccessor

内置文件访问器 YooAsset.IBuiltinFileAccessor

View Source

Declaration

BuiltinFileAccessor = 29


Enum EFileVerifyLevel

文件校验等级

Assembly: YooAsset.dll
View Source

Declaration

public enum EFileVerifyLevel

Fields

Low

验证文件存在

View Source

Declaration

Low = 1

Middle

验证文件大小

View Source

Declaration

Middle = 2

High

验证文件CRC

View Source

Declaration

High = 3


Enum EInstallCleanupMode

覆盖安装清理模式

Assembly: YooAsset.dll
View Source

Declaration

public enum EInstallCleanupMode

Fields

None

不做任何处理

View Source

Declaration

None = 0

ClearAllCacheFiles

清理所有缓存文件(包含资源文件和清单文件)

View Source

Declaration

ClearAllCacheFiles = 1

ClearAllBundleFiles

清理所有缓存的资源文件

View Source

Declaration

ClearAllBundleFiles = 2

ClearAllManifestFiles

清理所有缓存的清单文件

View Source

Declaration

ClearAllManifestFiles = 3


Class EnsureBundleFileOperation

确保资源包已就绪的异步操作

Assembly: YooAsset.dll
View Source

Declaration

public sealed class EnsureBundleFileOperation : AsyncOperationBase, IEnumerator, IComparable<AsyncOperationBase>

Properties

Detail

资源包文件详情

View Source

Declaration

public EnsureBundleFileOperation.BundleDetail Detail { get; }

Methods

InternalStart()

内部启动方法(子类必须实现)

View Source

Declaration

protected override void InternalStart()

InternalUpdate()

内部更新方法(子类必须实现)

View Source

Declaration

protected override void InternalUpdate()

Implements

  • System.Collections.IEnumerator

  • System.IComparable<YooAsset.AsyncOperationBase>


Struct EnsureBundleFileOperation.BundleDetail

资源包文件详情

Assembly: YooAsset.dll
View Source

Declaration

public readonly struct EnsureBundleFileOperation.BundleDetail

Fields

BundleName

资源包名称

View Source

Declaration

public readonly string BundleName

BundleFilePath

资源包文件的本地路径

View Source

Declaration

public readonly string BundleFilePath

BundleType

资源包类型

View Source

Declaration

public readonly int BundleType

IsEncrypted

文件是否加密

View Source

Declaration

public readonly bool IsEncrypted


Struct EnsureBundleFileOptions

确保资源包文件已就绪的操作选项

Assembly: YooAsset.dll
View Source

Declaration

public readonly struct EnsureBundleFileOptions

Properties

Location

资源定位地址

View Source

Declaration

public string Location { get; }

AssetInfo

资源信息

View Source

Declaration

public AssetInfo AssetInfo { get; }


Enum EOperationStatus

异步操作状态枚举

Assembly: YooAsset.dll
View Source

Declaration

public enum EOperationStatus

Fields

None

未开始

View Source

Declaration

None = 0

Processing

处理中

View Source

Declaration

Processing = 1

Succeeded

已成功

View Source

Declaration

Succeeded = 2

Failed

已失败

View Source

Declaration

Failed = 3


Enum EPlayMode

运行模式

Assembly: YooAsset.dll
View Source

Declaration

public enum EPlayMode

Fields

None

未指定运行模式

View Source

Declaration

None = 0

EditorSimulateMode

编辑器下的模拟模式

View Source

Declaration

EditorSimulateMode = 1

OfflinePlayMode

离线运行模式

View Source

Declaration

OfflinePlayMode = 2

HostPlayMode

联机运行模式

View Source

Declaration

HostPlayMode = 3

WebPlayMode

WebGL运行模式

View Source

Declaration

WebPlayMode = 4

CustomPlayMode

自定义运行模式

View Source

Declaration

CustomPlayMode = 5


Class FileSystemParameters

提供文件系统的创建参数与工厂方法

Assembly: YooAsset.dll
View Source

Declaration

public class FileSystemParameters

Properties

FileSystemTypeName

文件系统的完整类型名称

View Source

Declaration

public string FileSystemTypeName { get; }

PackageRoot

文件系统的根目录

View Source

Declaration

public string PackageRoot { get; }

Methods

AddParameter(string, object)

添加自定义参数

View Source

Declaration

public void AddParameter(string paramName, object value)

Parameters

TypeNameDescriptionSystem.StringparamName参数名称System.Objectvalue参数值

AddParameter(Enum, object)

添加自定义参数

View Source

Declaration

public void AddParameter(Enum paramType, object value)

Parameters

TypeNameDescriptionSystem.EnumparamType参数类型System.Objectvalue参数值

CreateDefaultEditorFileSystemParameters(string)

创建默认的编辑器文件系统参数

View Source

Declaration

public static FileSystemParameters CreateDefaultEditorFileSystemParameters(string packageRoot)

Returns

YooAsset.FileSystemParameters: 配置好的文件系统参数实例

Parameters

TypeNameDescriptionSystem.StringpackageRoot文件系统的根目录

CreateDefaultBuiltinFileSystemParameters(string)

创建默认的内置文件系统参数

View Source

Declaration

public static FileSystemParameters CreateDefaultBuiltinFileSystemParameters(string packageRoot)

Returns

YooAsset.FileSystemParameters: 配置好的文件系统参数实例

Parameters

TypeNameDescriptionSystem.StringpackageRoot文件系统的根目录

CreateDefaultBuiltinFileSystemParameters()

创建默认的内置文件系统参数

View Source

Declaration

public static FileSystemParameters CreateDefaultBuiltinFileSystemParameters()

Returns

YooAsset.FileSystemParameters: 配置好的文件系统参数实例### CreateDefaultSandboxFileSystemParameters(IRemoteService, string) 创建默认的沙盒文件系统参数

View Source

Declaration

public static FileSystemParameters CreateDefaultSandboxFileSystemParameters(IRemoteService remoteService, string packageRoot)

Returns

YooAsset.FileSystemParameters: 配置好的文件系统参数实例

Parameters

TypeNameDescriptionYooAsset.IRemoteServiceremoteService远端资源地址查询服务类System.StringpackageRoot文件系统的根目录

CreateDefaultSandboxFileSystemParameters(IRemoteService)

创建默认的沙盒文件系统参数

View Source

Declaration

public static FileSystemParameters CreateDefaultSandboxFileSystemParameters(IRemoteService remoteService)

Returns

YooAsset.FileSystemParameters: 配置好的文件系统参数实例

Parameters

TypeNameDescriptionYooAsset.IRemoteServiceremoteService远端资源地址查询服务类

CreateDefaultWebServerFileSystemParameters(bool)

创建默认的WebGL 服务器文件系统参数

View Source

Declaration

public static FileSystemParameters CreateDefaultWebServerFileSystemParameters(bool disableUnityWebCache)

Returns

YooAsset.FileSystemParameters: 配置好的文件系统参数实例

Parameters

TypeNameDescriptionSystem.BooleandisableUnityWebCache禁用Unity的网络缓存

CreateDefaultWebServerFileSystemParameters()

创建默认的WebGL 服务器文件系统参数

View Source

Declaration

public static FileSystemParameters CreateDefaultWebServerFileSystemParameters()

Returns

YooAsset.FileSystemParameters: 配置好的文件系统参数实例### CreateDefaultWebNetworkFileSystemParameters(IRemoteService, bool) 创建默认的 WebGL 网络文件系统参数

View Source

Declaration

public static FileSystemParameters CreateDefaultWebNetworkFileSystemParameters(IRemoteService remoteService, bool disableUnityWebCache)

Returns

YooAsset.FileSystemParameters: 配置好的文件系统参数实例

Parameters

TypeNameDescriptionYooAsset.IRemoteServiceremoteService远端资源地址查询服务类System.BooleandisableUnityWebCache禁用Unity的网络缓存

CreateDefaultWebNetworkFileSystemParameters(IRemoteService)

创建默认的 WebGL 网络文件系统参数

View Source

Declaration

public static FileSystemParameters CreateDefaultWebNetworkFileSystemParameters(IRemoteService remoteService)

Returns

YooAsset.FileSystemParameters: 配置好的文件系统参数实例

Parameters

TypeNameDescriptionYooAsset.IRemoteServiceremoteService远端资源地址查询服务类

Class HandleBase

资源句柄基类,提供资源加载状态查询和释放功能。

Assembly: YooAsset.dll
View Source

Declaration

public abstract class HandleBase : IEnumerator, IDisposable

Properties

Status

当前状态

View Source

Declaration

public EOperationStatus Status { get; }

Error

错误信息

View Source

Declaration

public string Error { get; }

Progress

加载进度

View Source

Declaration

public float Progress { get; }

IsDone

是否加载完毕

View Source

Declaration

public bool IsDone { get; }

IsValid

句柄是否有效

View Source

Declaration

public bool IsValid { get; }

Methods

Release()

释放资源句柄

View Source

Declaration

public void Release()

Dispose()

View Source

Declaration

public void Dispose()

GetAssetInfo()

获取资源信息

View Source

Declaration

public AssetInfo GetAssetInfo()

Returns

YooAsset.AssetInfo: 资源信息### GetAwaiter() 获取用于 async/await 的 Awaiter

View Source

Declaration

public OperationAwaiter GetAwaiter()

Returns

YooAsset.OperationAwaiter: 用于 async/await 的 Awaiter 对象

Implements

  • System.Collections.IEnumerator

  • System.IDisposable


Class HashUtility

哈希工具类

Assembly: YooAsset.dll
View Source

Declaration

public static class HashUtility

Methods

ComputeMD5(string)

计算字符串的MD5哈希值

View Source

Declaration

public static string ComputeMD5(string value)

Returns

System.String

Parameters

TypeNameSystem.Stringvalue

ComputeFileMD5(string)

计算文件的MD5哈希值

View Source

Declaration

public static string ComputeFileMD5(string filePath)

Returns

System.String

Parameters

TypeNameSystem.StringfilePath

ComputeMD5(Stream)

计算数据流的MD5哈希值

View Source

Declaration

public static string ComputeMD5(Stream stream)

Returns

System.String

Parameters

TypeNameSystem.IO.Streamstream

ComputeMD5(byte[])

计算字节数组的MD5哈希值

View Source

Declaration

public static string ComputeMD5(byte[] buffer)

Returns

System.String

Parameters

TypeNameSystem.Byte[]buffer

ComputeCrc32(string)

计算字符串的CRC32哈希值

View Source

Declaration

public static string ComputeCrc32(string value)

Returns

System.String

Parameters

TypeNameSystem.Stringvalue

ComputeCrc32AsUInt(string)

计算字符串的CRC32值返回无符号整数

View Source

Declaration

public static uint ComputeCrc32AsUInt(string value)

Returns

System.UInt32

Parameters

TypeNameSystem.Stringvalue

ComputeFileCrc32(string)

计算文件的CRC32哈希值

View Source

Declaration

public static string ComputeFileCrc32(string filePath)

Returns

System.String

Parameters

TypeNameSystem.StringfilePath

ComputeFileCrc32AsUInt(string)

计算文件的CRC32值返回无符号整数

View Source

Declaration

public static uint ComputeFileCrc32AsUInt(string filePath)

Returns

System.UInt32

Parameters

TypeNameSystem.StringfilePath

ComputeCrc32(Stream)

计算数据流的CRC32哈希值

View Source

Declaration

public static string ComputeCrc32(Stream stream)

Returns

System.String

Parameters

TypeNameSystem.IO.Streamstream

ComputeCrc32AsUInt(Stream)

计算数据流的CRC32值返回无符号整数

View Source

Declaration

public static uint ComputeCrc32AsUInt(Stream stream)

Returns

System.UInt32

Parameters

TypeNameSystem.IO.Streamstream

ComputeCrc32(byte[])

计算字节数组的CRC32哈希值

View Source

Declaration

public static string ComputeCrc32(byte[] buffer)

Returns

System.String

Parameters

TypeNameSystem.Byte[]buffer

ComputeCrc32AsUInt(byte[])

计算字节数组的CRC32值返回无符号整数

View Source

Declaration

public static uint ComputeCrc32AsUInt(byte[] buffer)

Returns

System.UInt32

Parameters

TypeNameSystem.Byte[]buffer

Class HostPlayModeOptions

联机运行模式的操作选项

Assembly: YooAsset.dll
View Source

Declaration

public class HostPlayModeOptions : InitializePackageOptions

Properties

BuiltinFileSystemParameters

内置文件系统初始化参数

View Source

Declaration

public FileSystemParameters BuiltinFileSystemParameters { get; set; }

CacheFileSystemParameters

缓存文件系统初始化参数

View Source

Declaration

public FileSystemParameters CacheFileSystemParameters { get; set; }


Interface IBuiltinFileAccessor

Assembly: YooAsset.dll
View Source

Declaration

public interface IBuiltinFileAccessor

Methods

FileExists(string)

检查内置文件是否存在

View Source

Declaration

bool FileExists(string filePath)

Returns

System.Boolean

Parameters

TypeNameDescriptionSystem.StringfilePath内置文件路径

ReadAllBytes(string)

读取内置文件的所有字节

View Source

Declaration

byte[] ReadAllBytes(string filePath)

Returns

System.Byte[]

Parameters

TypeNameDescriptionSystem.StringfilePath内置文件路径

Interface IBundleDecryptor

资源包解密器的基接口,本身不包含成员。

Assembly: YooAsset.dll
View Source

Declaration

public interface IBundleDecryptor


Interface IBundleEncryptor

定义资源包的加密行为

Assembly: YooAsset.dll
View Source

Declaration

public interface IBundleEncryptor

Methods

Encrypt(BundleEncryptArgs)

对指定的资源包文件执行加密

View Source

Declaration

BundleEncryptResult Encrypt(BundleEncryptArgs args)

Returns

YooAsset.BundleEncryptResult: 包含加密状态和加密后数据的结果

Parameters

TypeNameDescriptionYooAsset.BundleEncryptArgsargs加密操作的输入参数

Interface IBundleMemoryDecryptor

基于内存的资源包解密器。 将整个加密数据解密为字节数组后加载。

Assembly: YooAsset.dll
View Source

Declaration

public interface IBundleMemoryDecryptor : IBundleDecryptor

Methods

GetDecryptedData(BundleDecryptArgs)

将资源包数据解密并返回解密后的字节数组

View Source

Declaration

byte[] GetDecryptedData(BundleDecryptArgs args)

Returns

System.Byte[]: 解密后的资源包数据

Parameters

TypeNameDescriptionYooAsset.BundleDecryptArgsargs解密操作的输入参数

Interface IBundleOffsetDecryptor

基于偏移量的资源包解密器。 用于跳过文件头部加密区域后直接加载 AssetBundle。

Assembly: YooAsset.dll
View Source

Declaration

public interface IBundleOffsetDecryptor : IBundleDecryptor

Methods

GetFileOffset(BundleDecryptArgs)

获取解密数据的起始偏移量(字节)

View Source

Declaration

long GetFileOffset(BundleDecryptArgs args)

Returns

System.Int64: AssetBundle 有效数据在文件中的起始偏移量

Parameters

TypeNameDescriptionYooAsset.BundleDecryptArgsargs解密操作的输入参数

Interface IBundleStreamDecryptor

基于流的资源包解密器。 通过提供解密流实现流式加载,适用于大文件场景。

Assembly: YooAsset.dll
View Source

Declaration

public interface IBundleStreamDecryptor : IBundleDecryptor

Methods

GetBufferSize(BundleDecryptArgs)

获取流式读取时使用的缓冲区大小(字节)

View Source

Declaration

int GetBufferSize(BundleDecryptArgs args)

Returns

System.Int32: 建议的缓冲区字节数

Parameters

TypeNameDescriptionYooAsset.BundleDecryptArgsargs解密操作的输入参数

CreateDecryptionStream(BundleDecryptArgs)

创建用于解密读取的流实例

View Source

Declaration

Stream CreateDecryptionStream(BundleDecryptArgs args)

Returns

System.IO.Stream: 可供 AssetBundle 加载使用的解密流

Parameters

TypeNameDescriptionYooAsset.BundleDecryptArgsargs解密操作的输入参数

Interface IBundleUnpackPolicy

内置资源包解包策略接口

Assembly: YooAsset.dll
View Source

Declaration

public interface IBundleUnpackPolicy

Methods

IsUnpackBundle(BundleUnpackInfo)

判定指定资源包是否为需要解包的类型

View Source

Declaration

bool IsUnpackBundle(BundleUnpackInfo unpackInfo)

Returns

System.Boolean

Parameters

TypeNameYooAsset.BundleUnpackInfounpackInfo

Interface IDownloadRetryPolicy

下载重试策略

Assembly: YooAsset.dll
View Source

Declaration

public interface IDownloadRetryPolicy

Methods

IsRetryableError(string, long, string)

判断本次下载失败是否属于可重试的错误

View Source

Declaration

bool IsRetryableError(string url, long httpCode, string httpError)

Returns

System.Boolean: true 允许重试false 应立即失败。

Parameters

TypeNameDescriptionSystem.Stringurl请求地址System.Int64httpCodeHTTP 状态码0 表示网络中断或非 HTTP 错误)System.StringhttpError服务器返回的错误描述文本

CalculateRetryDelay(int, float)

计算本次重试应等待的时长(秒)

View Source

Declaration

float CalculateRetryDelay(int retryCount, float previousDelay)

Returns

System.Single: 本次应等待的秒数

Parameters

TypeNameDescriptionSystem.Int32retryCount即将进入的重试次数(从 1 开始)System.SinglepreviousDelay上一次等待时长(首次时为 0

Interface IDownloadUrlPolicy

URL 选择策略

Assembly: YooAsset.dll
View Source

Declaration

public interface IDownloadUrlPolicy

Methods

SelectUrl(IReadOnlyList)

选择本次请求应使用的 URL

View Source

Declaration

string SelectUrl(IReadOnlyList<string> candidateUrls)

Returns

System.String: 选中的 URL

Parameters

TypeNameDescriptionSystem.Collections.Generic.IReadOnlyList<System.String>candidateUrls候选 URL 列表(至少包含一个)

OnRequestSucceeded(string)

反馈请求成功,策略可据此更新内部状态。

View Source

Declaration

void OnRequestSucceeded(string url)

Parameters

TypeNameDescriptionSystem.Stringurl实际使用的 URL

OnRequestFailed(string, long, string)

反馈请求失败,策略可据此更新内部状态。

View Source

Declaration

void OnRequestFailed(string url, long httpCode, string httpError)

Parameters

TypeNameDescriptionSystem.Stringurl实际使用的 URLSystem.Int64httpCodeHTTP 状态码0 表示网络中断或非 HTTP 错误)System.StringhttpError服务器返回的错误描述文本

Interface ILogger

自定义日志处理接口

Assembly: YooAsset.dll
View Source

Declaration

public interface ILogger

Methods

Log(string)

输出普通日志

View Source

Declaration

void Log(string message)

Parameters

TypeNameSystem.Stringmessage

LogWarning(string)

输出警告日志

View Source

Declaration

void LogWarning(string message)

Parameters

TypeNameSystem.Stringmessage

LogError(string)

输出错误日志

View Source

Declaration

void LogError(string message)

Parameters

TypeNameSystem.Stringmessage

LogException(Exception)

输出异常日志

View Source

Declaration

void LogException(Exception exception)

Parameters

TypeNameSystem.Exceptionexception

Interface IManifestDecryptor

资源清单解密器

Assembly: YooAsset.dll
View Source

Declaration

public interface IManifestDecryptor

Methods

Decrypt(byte[])

对加密的资源清单数据执行解密

View Source

Declaration

byte[] Decrypt(byte[] fileData)

Returns

System.Byte[]: 解密后的字节数组

Parameters

TypeNameDescriptionSystem.Byte[]fileData已加密的清单数据

Interface IManifestEncryptor

资源清单加密器

Assembly: YooAsset.dll
View Source

Declaration

public interface IManifestEncryptor

Methods

Encrypt(byte[])

对资源清单的原始数据执行加密

View Source

Declaration

byte[] Encrypt(byte[] fileData)

Returns

System.Byte[]: 加密后的字节数组

Parameters

TypeNameDescriptionSystem.Byte[]fileData待加密的清单数据

Struct ImportBundleInfo

导入的资源包信息

Assembly: YooAsset.dll
View Source

Declaration

public readonly struct ImportBundleInfo

Properties

FilePath

本地文件路径

View Source

Declaration

public string FilePath { get; }

BundleName

资源包名称

View Source

Declaration

public string BundleName { get; }

BundleGuid

资源包GUID

View Source

Declaration

public string BundleGuid { get; }


Class InitializeFileSystemOperation

初始化文件系统操作

Assembly: YooAsset.dll
View Source

Declaration

public sealed class InitializeFileSystemOperation : AsyncOperationBase, IEnumerator, IComparable<AsyncOperationBase>

Methods

InternalStart()

内部启动方法(子类必须实现)

View Source

Declaration

protected override void InternalStart()

InternalUpdate()

内部更新方法(子类必须实现)

View Source

Declaration

protected override void InternalUpdate()

Implements

  • System.Collections.IEnumerator

  • System.IComparable<YooAsset.AsyncOperationBase>


Class InitializePackageOperation

初始化资源包裹操作

Assembly: YooAsset.dll
View Source

Declaration

public sealed class InitializePackageOperation : AsyncOperationBase, IEnumerator, IComparable<AsyncOperationBase>

Methods

InternalStart()

内部启动方法(子类必须实现)

View Source

Declaration

protected override void InternalStart()

InternalUpdate()

内部更新方法(子类必须实现)

View Source

Declaration

protected override void InternalUpdate()

InternalGetDescription()

获取操作的描述信息(子类可选实现)

View Source

Declaration

protected override string InternalGetDescription()

Returns

System.String: 操作的描述字符串,默认返回空字符串。

Implements

  • System.Collections.IEnumerator

  • System.IComparable<YooAsset.AsyncOperationBase>


Class InitializePackageOptions

初始化资源包的操作选项

Assembly: YooAsset.dll
View Source

Declaration

public abstract class InitializePackageOptions

Properties

BundleLoadingMaxConcurrency

同时加载Bundle文件的最大并发数

View Source

Declaration

public int BundleLoadingMaxConcurrency { get; set; }

AutoUnloadBundleWhenUnused

是否在资源引用计数为零时自动释放资源包

View Source

Declaration

public bool AutoUnloadBundleWhenUnused { get; set; }

WebGLForceSyncLoadAsset

是否在WebGL平台强制同步加载资源对象

View Source

Declaration

public bool WebGLForceSyncLoadAsset { get; set; }


Class InstantiateOperation

游戏对象实例化操作

Assembly: YooAsset.dll
View Source

Declaration

public sealed class InstantiateOperation : AsyncOperationBase, IEnumerator, IComparable<AsyncOperationBase>

Properties

Result

实例化的游戏对象

View Source

Declaration

public GameObject Result { get; }

Methods

InternalStart()

内部启动方法(子类必须实现)

View Source

Declaration

protected override void InternalStart()

InternalUpdate()

内部更新方法(子类必须实现)

View Source

Declaration

protected override void InternalUpdate()

InternalWaitForCompletion()

内部同步等待方法(子类可选实现)

View Source

Declaration

protected override void InternalWaitForCompletion()

InternalGetDescription()

获取操作的描述信息(子类可选实现)

View Source

Declaration

protected override string InternalGetDescription()

Returns

System.String: 操作的描述字符串,默认返回空字符串。### Cancel() 取消实例化对象操作

View Source

Declaration

public void Cancel()

Implements

  • System.Collections.IEnumerator

  • System.IComparable<YooAsset.AsyncOperationBase>


Struct InstantiateOptions

游戏对象实例化的操作选项

Assembly: YooAsset.dll
View Source

Declaration

public readonly struct InstantiateOptions

Properties

IsActive

是否激活实例化对象

View Source

Declaration

public bool IsActive { get; }

Parent

将指定给新对象的父对象

View Source

Declaration

public Transform Parent { get; }

InWorldSpace

是否在世界空间中定位新对象

View Source

Declaration

public bool InWorldSpace { get; }

Position

新对象的位置

View Source

Declaration

public Vector3 Position { get; }

Rotation

新对象的旋转

View Source

Declaration

public Quaternion Rotation { get; }


Interface IRemoteService

远端资源服务

Assembly: YooAsset.dll
View Source

Declaration

public interface IRemoteService

Methods

GetRemoteUrls(string)

获取指定文件的所有远端候选地址,按优先级排序。

View Source

Declaration

IReadOnlyList<string> GetRemoteUrls(string fileName)

Returns

System.Collections.Generic.IReadOnlyList<System.String>: 按优先级排序的远端候选地址列表,至少包含一个 URL。

Parameters

TypeNameDescriptionSystem.StringfileName请求的文件名称

Class LoadPackageManifestOperation

加载资源清单操作

Assembly: YooAsset.dll
View Source

Declaration

public sealed class LoadPackageManifestOperation : AsyncOperationBase, IEnumerator, IComparable<AsyncOperationBase>

Methods

InternalStart()

内部启动方法(子类必须实现)

View Source

Declaration

protected override void InternalStart()

InternalUpdate()

内部更新方法(子类必须实现)

View Source

Declaration

protected override void InternalUpdate()

InternalGetDescription()

获取操作的描述信息(子类可选实现)

View Source

Declaration

protected override string InternalGetDescription()

Returns

System.String: 操作的描述字符串,默认返回空字符串。

Implements

  • System.Collections.IEnumerator

  • System.IComparable<YooAsset.AsyncOperationBase>


Struct LoadPackageManifestOptions

加载清单的操作选项

Assembly: YooAsset.dll
View Source

Declaration

public readonly struct LoadPackageManifestOptions

Properties

PackageVersion

包裹版本

View Source

Declaration

public string PackageVersion { get; }

Timeout

超时时间

View Source

Declaration

public int Timeout { get; }


Class OfflinePlayModeOptions

离线运行模式的操作选项

Assembly: YooAsset.dll
View Source

Declaration

public class OfflinePlayModeOptions : InitializePackageOptions

Properties

BuiltinFileSystemParameters

内置文件系统初始化参数

View Source

Declaration

public FileSystemParameters BuiltinFileSystemParameters { get; set; }


Struct OperationAwaiter

支持异步编程的自定义 Awaiter

Assembly: YooAsset.dll
View Source

Declaration

public readonly struct OperationAwaiter : ICriticalNotifyCompletion, INotifyCompletion

Properties

IsCompleted

View Source

Declaration

public bool IsCompleted { get; }

Methods

GetResult()

获取操作结果

View Source

Declaration

public void GetResult()

OnCompleted(Action)

View Source

Declaration

public void OnCompleted(Action continuation)

Parameters

TypeNameSystem.Actioncontinuation

UnsafeOnCompleted(Action)

View Source

Declaration

public void UnsafeOnCompleted(Action continuation)

Parameters

TypeNameSystem.Actioncontinuation

Implements

  • System.Runtime.CompilerServices.ICriticalNotifyCompletion

  • System.Runtime.CompilerServices.INotifyCompletion


Class PackageBuildParameters

资源包裹构建的调用参数

Assembly: YooAsset.dll
View Source

Declaration

public class PackageBuildParameters

Properties

PackageName

包裹名称

View Source

Declaration

public string PackageName { get; }

BuildPipelineName

构建管线名称

View Source

Declaration

public string BuildPipelineName { get; set; }

BuildBundleType

构建资源包类型

View Source

Declaration

public int BuildBundleType { get; set; }

UserData

用户自定义数据

View Source

Declaration

public object UserData { get; set; }

AssemblyName

构建类所属的程序集名称

View Source

Declaration

public string AssemblyName { get; set; }

TypeFullName

构建执行的类型全称

View Source

Declaration

public string TypeFullName { get; set; }

MethodName

构建执行的方法名称

View Source

Declaration

public string MethodName { get; set; }


Class PackageBuildResult

资源包裹构建的返回结果

Assembly: YooAsset.dll
View Source

Declaration

public class PackageBuildResult

Properties

PackageRootDirectory

构建输出的资源包裹根目录路径

View Source

Declaration

public string PackageRootDirectory { get; }


Class PackageDetails

资源包裹的详细信息,用于外部查询包裹配置。

Assembly: YooAsset.dll
View Source

Declaration

public class PackageDetails

Properties

FileVersion

文件版本

View Source

Declaration

public int FileVersion { get; }

EnableAddressable

启用可寻址资源定位

View Source

Declaration

public bool EnableAddressable { get; }

SupportExtensionless

支持无后缀名的资源定位地址

View Source

Declaration

public bool SupportExtensionless { get; }

LocationToLower

资源定位地址大小写不敏感

View Source

Declaration

public bool LocationToLower { get; }

IncludeAssetGuid

包含资源GUID数据

View Source

Declaration

public bool IncludeAssetGuid { get; }

ReplaceAssetPathWithAddress

使用可寻址地址代替资源路径

View Source

Declaration

public bool ReplaceAssetPathWithAddress { get; }

OutputNameStyle

文件名称样式

View Source

Declaration

public int OutputNameStyle { get; }

BuildBundleType

构建资源包类型

View Source

Declaration

public int BuildBundleType { get; }

BuildPipeline

构建管线名称

View Source

Declaration

public string BuildPipeline { get; }

PackageName

资源包裹名称

View Source

Declaration

public string PackageName { get; }

PackageVersion

资源包裹的版本信息

View Source

Declaration

public string PackageVersion { get; }

PackageNote

资源包裹的备注信息

View Source

Declaration

public string PackageNote { get; }

AssetTotalCount

主资源文件总数

View Source

Declaration

public int AssetTotalCount { get; }

BundleTotalCount

资源包文件总数

View Source

Declaration

public int BundleTotalCount { get; }


Class PrefetchManifestOperation

预取清单操作,用于提前加载指定版本的资源清单。

Assembly: YooAsset.dll
View Source

Declaration

public sealed class PrefetchManifestOperation : AsyncOperationBase, IEnumerator, IComparable<AsyncOperationBase>

Methods

InternalStart()

内部启动方法(子类必须实现)

View Source

Declaration

protected override void InternalStart()

InternalUpdate()

内部更新方法(子类必须实现)

View Source

Declaration

protected override void InternalUpdate()

CreateResourceDownloader(ResourceDownloaderOptions)

创建资源下载器,用于下载指定的资源标签列表关联的资源包文件。

View Source

Declaration

public ResourceDownloaderOperation CreateResourceDownloader(ResourceDownloaderOptions options)

Returns

YooAsset.ResourceDownloaderOperation: 资源下载操作实例

Parameters

TypeNameDescriptionYooAsset.ResourceDownloaderOptionsoptions资源下载选项

CreateBundleDownloader(BundleDownloaderOptions)

创建资源下载器,用于下载指定的资源信息列表依赖的资源包文件。

View Source

Declaration

public ResourceDownloaderOperation CreateBundleDownloader(BundleDownloaderOptions options)

Returns

YooAsset.ResourceDownloaderOperation: 资源下载操作实例

Parameters

TypeNameDescriptionYooAsset.BundleDownloaderOptionsoptions资源包下载选项

Implements

  • System.Collections.IEnumerator

  • System.IComparable<YooAsset.AsyncOperationBase>


Struct PrefetchManifestOptions

预取清单的操作选项

Assembly: YooAsset.dll
View Source

Declaration

public readonly struct PrefetchManifestOptions

Properties

PackageVersion

预取的包裹版本

View Source

Declaration

public string PackageVersion { get; }

Timeout

资源清单请求超时时间

View Source

Declaration

public int Timeout { get; }


Class RawFileHandle

原生文件句柄,用于访问未经 Unity 处理的原始文件。

Assembly: YooAsset.dll
View Source

Declaration

public sealed class RawFileHandle : HandleBase, IEnumerator, IDisposable

Methods

WaitForAsyncComplete()

等待异步执行完毕

View Source

Declaration

public void WaitForAsyncComplete()

GetRawFilePath()

获取原生文件的路径

View Source

Declaration

public string GetRawFilePath()

Returns

System.String: 原生文件的磁盘路径## Events

Completed

当加载完成时触发

View Source

Declaration

public event Action<RawFileHandle> Completed

Event Type

System.Action<YooAsset.RawFileHandle>

Implements

  • System.Collections.IEnumerator

  • System.IDisposable


Class RawFileObject

原生文件对象

Assembly: YooAsset.dll
View Source

Declaration

public class RawFileObject : ScriptableObject

Methods

GetBytes()

获取原生文件的字节数据

View Source

Declaration

public byte[] GetBytes()

Returns

System.Byte[]: 原生文件字节数据的副本### GetText() 获取以 UTF-8 编码解析的文本内容

View Source

Declaration

public string GetText()

Returns

System.String: 解析后的文本字符串

Class RequestPackageVersionOperation

请求包裹版本操作

Assembly: YooAsset.dll
View Source

Declaration

public sealed class RequestPackageVersionOperation : AsyncOperationBase, IEnumerator, IComparable<AsyncOperationBase>

Properties

PackageVersion

当前最新的包裹版本

View Source

Declaration

public string PackageVersion { get; }

Methods

InternalStart()

内部启动方法(子类必须实现)

View Source

Declaration

protected override void InternalStart()

InternalUpdate()

内部更新方法(子类必须实现)

View Source

Declaration

protected override void InternalUpdate()

Implements

  • System.Collections.IEnumerator

  • System.IComparable<YooAsset.AsyncOperationBase>


Struct RequestPackageVersionOptions

请求版本的操作选项

Assembly: YooAsset.dll
View Source

Declaration

public readonly struct RequestPackageVersionOptions

Properties

AppendTimeTicks

是否在URL末尾添加时间戳

View Source

Declaration

public bool AppendTimeTicks { get; }

Timeout

超时时间

View Source

Declaration

public int Timeout { get; }


Class ResourceDownloaderOperation

资源下载操作类

Assembly: YooAsset.dll
View Source

Declaration

public sealed class ResourceDownloaderOperation : DownloaderOperation, IEnumerator, IComparable<AsyncOperationBase>

Implements

  • System.Collections.IEnumerator

  • System.IComparable<YooAsset.AsyncOperationBase>


Struct ResourceDownloaderOptions

按资源标签创建下载器的操作选项

Assembly: YooAsset.dll
View Source

Declaration

public readonly struct ResourceDownloaderOptions

Properties

MaximumConcurrency

最大并发数量

View Source

Declaration

public int MaximumConcurrency { get; }

RetryCount

失败后的重试次数

View Source

Declaration

public int RetryCount { get; }

Tags

资源标签列表

View Source

Declaration

public string[] Tags { get; }


Class ResourceImporterOperation

资源导入操作类

Assembly: YooAsset.dll
View Source

Declaration

public sealed class ResourceImporterOperation : DownloaderOperation, IEnumerator, IComparable<AsyncOperationBase>

Implements

  • System.Collections.IEnumerator

  • System.IComparable<YooAsset.AsyncOperationBase>


Class ResourcePackage

资源包裹类

Assembly: YooAsset.dll
View Source

Declaration

public class ResourcePackage

Properties

PackageName

包裹名称

View Source

Declaration

public string PackageName { get; }

PackageValid

包裹是否有效

View Source

Declaration

public bool PackageValid { get; }

PackagePriority

包裹优先级(值越大越优先更新)

View Source

Declaration

public uint PackagePriority { get; set; }

InitializeStatus

初始化状态

View Source

Declaration

public EOperationStatus InitializeStatus { get; }

Methods

InitializePackageAsync(InitializePackageOptions)

初始化包裹

View Source

Declaration

public InitializePackageOperation InitializePackageAsync(InitializePackageOptions options)

Returns

YooAsset.InitializePackageOperation: 返回初始化操作对象

Parameters

TypeNameDescriptionYooAsset.InitializePackageOptionsoptions初始化参数

DestroyPackageAsync()

销毁包裹

View Source

Declaration

public DestroyPackageOperation DestroyPackageAsync()

Returns

YooAsset.DestroyPackageOperation: 返回销毁包裹操作对象### RequestPackageVersionAsync() 请求最新的资源版本

View Source

Declaration

public RequestPackageVersionOperation RequestPackageVersionAsync()

Returns

YooAsset.RequestPackageVersionOperation: 返回请求版本操作对象### RequestPackageVersionAsync(RequestPackageVersionOptions) 请求最新的资源版本

View Source

Declaration

public RequestPackageVersionOperation RequestPackageVersionAsync(RequestPackageVersionOptions options)

Returns

YooAsset.RequestPackageVersionOperation: 返回请求版本操作对象

Parameters

TypeNameDescriptionYooAsset.RequestPackageVersionOptionsoptions请求版本选项

LoadPackageManifestAsync(LoadPackageManifestOptions)

加载指定版本的资源清单

View Source

Declaration

public LoadPackageManifestOperation LoadPackageManifestAsync(LoadPackageManifestOptions options)

Returns

YooAsset.LoadPackageManifestOperation: 返回加载清单操作对象

Parameters

TypeNameDescriptionYooAsset.LoadPackageManifestOptionsoptions加载清单选项

PrefetchManifestAsync(PrefetchManifestOptions)

预取指定版本的包裹资源清单

View Source

Declaration

public PrefetchManifestOperation PrefetchManifestAsync(PrefetchManifestOptions options)

Returns

YooAsset.PrefetchManifestOperation: 返回预取清单操作对象

Parameters

TypeNameDescriptionYooAsset.PrefetchManifestOptionsoptions预取清单选项

ClearCacheAsync(ClearCacheOptions)

清理缓存文件

View Source

Declaration

public ClearCacheOperation ClearCacheAsync(ClearCacheOptions options)

Returns

YooAsset.ClearCacheOperation: 返回清理缓存操作对象

Parameters

TypeNameDescriptionYooAsset.ClearCacheOptionsoptions清理缓存选项

GetPackageVersion()

获取当前加载包裹的版本信息

View Source

Declaration

public string GetPackageVersion()

Returns

System.String: 返回当前包裹版本字符串### GetPackageNote() 获取当前加载包裹的备注信息

View Source

Declaration

public string GetPackageNote()

Returns

System.String: 返回当前包裹备注字符串### GetPackageDetails() 获取当前加载包裹的详细信息

View Source

Declaration

public PackageDetails GetPackageDetails()

Returns

YooAsset.PackageDetails: 返回包含包裹配置的详细信息对象### UnloadAllAssetsAsync() 强制回收所有资源

View Source

Declaration

public UnloadAllAssetsOperation UnloadAllAssetsAsync()

Returns

YooAsset.UnloadAllAssetsOperation: 返回卸载资源操作对象### UnloadAllAssetsAsync(UnloadAllAssetsOptions) 强制回收所有资源

View Source

Declaration

public UnloadAllAssetsOperation UnloadAllAssetsAsync(UnloadAllAssetsOptions options)

Returns

YooAsset.UnloadAllAssetsOperation: 返回卸载资源操作对象

Parameters

TypeNameDescriptionYooAsset.UnloadAllAssetsOptionsoptions卸载选项

UnloadUnusedAssetsAsync()

回收不再使用的资源

View Source

Declaration

public UnloadUnusedAssetsOperation UnloadUnusedAssetsAsync()

Returns

YooAsset.UnloadUnusedAssetsOperation: 返回卸载未使用资源操作对象### UnloadUnusedAssetsAsync(UnloadUnusedAssetsOptions) 回收不再使用的资源

View Source

Declaration

public UnloadUnusedAssetsOperation UnloadUnusedAssetsAsync(UnloadUnusedAssetsOptions options)

Returns

YooAsset.UnloadUnusedAssetsOperation: 返回卸载未使用资源操作对象

Parameters

TypeNameDescriptionYooAsset.UnloadUnusedAssetsOptionsoptions卸载选项

TryUnloadUnusedAsset(string, int)

尝试卸载指定的未使用资源

View Source

Declaration

public void TryUnloadUnusedAsset(string location, int loopCount = 10)

Parameters

TypeNameDescriptionSystem.Stringlocation资源的定位地址System.Int32loopCount最大循环卸载次数

TryUnloadUnusedAsset(AssetInfo, int)

尝试卸载指定的未使用资源

View Source

Declaration

public void TryUnloadUnusedAsset(AssetInfo assetInfo, int loopCount = 10)

Parameters

TypeNameDescriptionYooAsset.AssetInfoassetInfo资源信息System.Int32loopCount最大循环卸载次数

GetDownloadSize(string)

获取指定资源需要下载的文件总大小

View Source

Declaration

public long GetDownloadSize(string location)

Returns

System.Int64: 返回需要下载的字节数0 表示不需要下载。

Parameters

TypeNameDescriptionSystem.Stringlocation资源的定位地址

GetDownloadSize(AssetInfo)

获取指定资源需要下载的文件总大小

View Source

Declaration

public long GetDownloadSize(AssetInfo assetInfo)

Returns

System.Int64: 返回需要下载的字节数0 表示不需要下载。

Parameters

TypeNameDescriptionYooAsset.AssetInfoassetInfo资源信息

GetAllAssetInfos()

获取所有的资源信息

View Source

Declaration

public AssetInfo[] GetAllAssetInfos()

Returns

YooAsset.AssetInfo[]: 返回包含所有资源信息的数组### GetAssetInfos(string) 获取资源信息列表

View Source

Declaration

public AssetInfo[] GetAssetInfos(string tag)

Returns

YooAsset.AssetInfo[]: 返回匹配标签的资源信息数组

Parameters

TypeNameDescriptionSystem.Stringtag资源标签

GetAssetInfos(string[])

获取资源信息列表

View Source

Declaration

public AssetInfo[] GetAssetInfos(string[] tags)

Returns

YooAsset.AssetInfo[]: 返回匹配标签的资源信息数组

Parameters

TypeNameDescriptionSystem.String[]tags资源标签列表

GetAssetInfo(string)

获取资源信息

View Source

Declaration

public AssetInfo GetAssetInfo(string location)

Returns

YooAsset.AssetInfo: 返回资源信息对象

Parameters

TypeNameDescriptionSystem.Stringlocation资源的定位地址

GetAssetInfo(string, Type)

获取资源信息

View Source

Declaration

public AssetInfo GetAssetInfo(string location, Type type)

Returns

YooAsset.AssetInfo: 返回资源信息对象

Parameters

TypeNameDescriptionSystem.Stringlocation资源的定位地址System.Typetype资源类型

GetAssetInfoByGuid(string)

获取资源信息

View Source

Declaration

public AssetInfo GetAssetInfoByGuid(string assetGuid)

Returns

YooAsset.AssetInfo: 返回资源信息对象

Parameters

TypeNameDescriptionSystem.StringassetGuid资源GUID

GetAssetInfoByGuid(string, Type)

获取资源信息

View Source

Declaration

public AssetInfo GetAssetInfoByGuid(string assetGuid, Type type)

Returns

YooAsset.AssetInfo: 返回资源信息对象

Parameters

TypeNameDescriptionSystem.StringassetGuid资源GUIDSystem.Typetype资源类型

IsLocationValid(string)

资源定位地址是否有效

View Source

Declaration

public bool IsLocationValid(string location)

Returns

System.Boolean: 如果地址有效返回true否则返回false。

Parameters

TypeNameDescriptionSystem.Stringlocation资源的定位地址

LoadSceneSync(string, LoadSceneMode, LocalPhysicsMode)

同步加载场景

View Source

Declaration

public SceneHandle LoadSceneSync(string location, LoadSceneMode sceneMode = LoadSceneMode.Single, LocalPhysicsMode physicsMode = LocalPhysicsMode.None)

Returns

YooAsset.SceneHandle: 返回场景操作句柄

Parameters

TypeNameDescriptionSystem.Stringlocation场景的定位地址UnityEngine.SceneManagement.LoadSceneModesceneMode场景加载模式UnityEngine.SceneManagement.LocalPhysicsModephysicsMode场景物理模式

LoadSceneSync(AssetInfo, LoadSceneMode, LocalPhysicsMode)

同步加载场景

View Source

Declaration

public SceneHandle LoadSceneSync(AssetInfo assetInfo, LoadSceneMode sceneMode = LoadSceneMode.Single, LocalPhysicsMode physicsMode = LocalPhysicsMode.None)

Returns

YooAsset.SceneHandle: 返回场景操作句柄

Parameters

TypeNameDescriptionYooAsset.AssetInfoassetInfo场景的资源信息UnityEngine.SceneManagement.LoadSceneModesceneMode场景加载模式UnityEngine.SceneManagement.LocalPhysicsModephysicsMode场景物理模式

LoadSceneAsync(string, LoadSceneMode, LocalPhysicsMode, bool, uint)

加载场景

View Source

Declaration

public SceneHandle LoadSceneAsync(string location, LoadSceneMode sceneMode = LoadSceneMode.Single, LocalPhysicsMode physicsMode = LocalPhysicsMode.None, bool allowSceneActivation = true, uint priority = 0)

Returns

YooAsset.SceneHandle: 返回场景操作句柄

Parameters

TypeNameDescriptionSystem.Stringlocation场景的定位地址UnityEngine.SceneManagement.LoadSceneModesceneMode场景加载模式UnityEngine.SceneManagement.LocalPhysicsModephysicsMode场景物理模式System.BooleanallowSceneActivation是否允许场景激活System.UInt32priority加载的优先级

LoadSceneAsync(AssetInfo, LoadSceneMode, LocalPhysicsMode, bool, uint)

加载场景

View Source

Declaration

public SceneHandle LoadSceneAsync(AssetInfo assetInfo, LoadSceneMode sceneMode = LoadSceneMode.Single, LocalPhysicsMode physicsMode = LocalPhysicsMode.None, bool allowSceneActivation = true, uint priority = 0)

Returns

YooAsset.SceneHandle: 返回场景操作句柄

Parameters

TypeNameDescriptionYooAsset.AssetInfoassetInfo场景的资源信息UnityEngine.SceneManagement.LoadSceneModesceneMode场景加载模式UnityEngine.SceneManagement.LocalPhysicsModephysicsMode场景物理模式System.BooleanallowSceneActivation是否允许场景激活System.UInt32priority加载的优先级

LoadAssetSync(AssetInfo)

同步加载资源对象

View Source

Declaration

public AssetHandle LoadAssetSync(AssetInfo assetInfo)

Returns

YooAsset.AssetHandle: 返回资源操作句柄

Parameters

TypeNameDescriptionYooAsset.AssetInfoassetInfo资源信息

LoadAssetSync(string)

同步加载资源对象

View Source

Declaration

public AssetHandle LoadAssetSync<TObject>(string location) where TObject : Object

Returns

YooAsset.AssetHandle: 返回资源操作句柄

Parameters

TypeNameDescriptionSystem.Stringlocation资源的定位地址

Type Parameters

NameDescriptionTObject资源类型

LoadAssetSync(string, Type)

同步加载资源对象

View Source

Declaration

public AssetHandle LoadAssetSync(string location, Type type)

Returns

YooAsset.AssetHandle: 返回资源操作句柄

Parameters

TypeNameDescriptionSystem.Stringlocation资源的定位地址System.Typetype资源类型

LoadAssetSync(string)

同步加载资源对象

View Source

Declaration

public AssetHandle LoadAssetSync(string location)

Returns

YooAsset.AssetHandle: 返回资源操作句柄

Parameters

TypeNameDescriptionSystem.Stringlocation资源的定位地址

LoadAssetAsync(AssetInfo, uint)

加载资源对象

View Source

Declaration

public AssetHandle LoadAssetAsync(AssetInfo assetInfo, uint priority = 0)

Returns

YooAsset.AssetHandle: 返回资源操作句柄

Parameters

TypeNameDescriptionYooAsset.AssetInfoassetInfo资源信息System.UInt32priority加载的优先级

LoadAssetAsync(string, uint)

加载资源对象

View Source

Declaration

public AssetHandle LoadAssetAsync<TObject>(string location, uint priority = 0) where TObject : Object

Returns

YooAsset.AssetHandle: 返回资源操作句柄

Parameters

TypeNameDescriptionSystem.Stringlocation资源的定位地址System.UInt32priority加载的优先级

Type Parameters

NameDescriptionTObject资源类型

LoadAssetAsync(string, Type, uint)

加载资源对象

View Source

Declaration

public AssetHandle LoadAssetAsync(string location, Type type, uint priority = 0)

Returns

YooAsset.AssetHandle: 返回资源操作句柄

Parameters

TypeNameDescriptionSystem.Stringlocation资源的定位地址System.Typetype资源类型System.UInt32priority加载的优先级

LoadAssetAsync(string, uint)

加载资源对象

View Source

Declaration

public AssetHandle LoadAssetAsync(string location, uint priority = 0)

Returns

YooAsset.AssetHandle: 返回资源操作句柄

Parameters

TypeNameDescriptionSystem.Stringlocation资源的定位地址System.UInt32priority加载的优先级

LoadSubAssetsSync(AssetInfo)

同步加载子资源对象

View Source

Declaration

public SubAssetsHandle LoadSubAssetsSync(AssetInfo assetInfo)

Returns

YooAsset.SubAssetsHandle: 返回子资源操作句柄

Parameters

TypeNameDescriptionYooAsset.AssetInfoassetInfo资源信息

LoadSubAssetsSync(string)

同步加载子资源对象

View Source

Declaration

public SubAssetsHandle LoadSubAssetsSync<TObject>(string location) where TObject : Object

Returns

YooAsset.SubAssetsHandle: 返回子资源操作句柄

Parameters

TypeNameDescriptionSystem.Stringlocation资源的定位地址

Type Parameters

NameDescriptionTObject资源类型

LoadSubAssetsSync(string, Type)

同步加载子资源对象

View Source

Declaration

public SubAssetsHandle LoadSubAssetsSync(string location, Type type)

Returns

YooAsset.SubAssetsHandle: 返回子资源操作句柄

Parameters

TypeNameDescriptionSystem.Stringlocation资源的定位地址System.Typetype子对象类型

LoadSubAssetsSync(string)

同步加载子资源对象

View Source

Declaration

public SubAssetsHandle LoadSubAssetsSync(string location)

Returns

YooAsset.SubAssetsHandle: 返回子资源操作句柄

Parameters

TypeNameDescriptionSystem.Stringlocation资源的定位地址

LoadSubAssetsAsync(AssetInfo, uint)

加载子资源对象

View Source

Declaration

public SubAssetsHandle LoadSubAssetsAsync(AssetInfo assetInfo, uint priority = 0)

Returns

YooAsset.SubAssetsHandle: 返回子资源操作句柄

Parameters

TypeNameDescriptionYooAsset.AssetInfoassetInfo资源信息System.UInt32priority加载的优先级

LoadSubAssetsAsync(string, uint)

加载子资源对象

View Source

Declaration

public SubAssetsHandle LoadSubAssetsAsync<TObject>(string location, uint priority = 0) where TObject : Object

Returns

YooAsset.SubAssetsHandle: 返回子资源操作句柄

Parameters

TypeNameDescriptionSystem.Stringlocation资源的定位地址System.UInt32priority加载的优先级

Type Parameters

NameDescriptionTObject资源类型

LoadSubAssetsAsync(string, Type, uint)

加载子资源对象

View Source

Declaration

public SubAssetsHandle LoadSubAssetsAsync(string location, Type type, uint priority = 0)

Returns

YooAsset.SubAssetsHandle: 返回子资源操作句柄

Parameters

TypeNameDescriptionSystem.Stringlocation资源的定位地址System.Typetype子对象类型System.UInt32priority加载的优先级

LoadSubAssetsAsync(string, uint)

加载子资源对象

View Source

Declaration

public SubAssetsHandle LoadSubAssetsAsync(string location, uint priority = 0)

Returns

YooAsset.SubAssetsHandle: 返回子资源操作句柄

Parameters

TypeNameDescriptionSystem.Stringlocation资源的定位地址System.UInt32priority加载的优先级

LoadAllAssetsSync(AssetInfo)

同步加载资源包内所有资源对象

View Source

Declaration

public AllAssetsHandle LoadAllAssetsSync(AssetInfo assetInfo)

Returns

YooAsset.AllAssetsHandle: 返回全资源操作句柄

Parameters

TypeNameDescriptionYooAsset.AssetInfoassetInfo资源信息

LoadAllAssetsSync(string)

同步加载资源包内所有资源对象

View Source

Declaration

public AllAssetsHandle LoadAllAssetsSync<TObject>(string location) where TObject : Object

Returns

YooAsset.AllAssetsHandle: 返回全资源操作句柄

Parameters

TypeNameDescriptionSystem.Stringlocation资源的定位地址

Type Parameters

NameDescriptionTObject资源类型

LoadAllAssetsSync(string, Type)

同步加载资源包内所有资源对象

View Source

Declaration

public AllAssetsHandle LoadAllAssetsSync(string location, Type type)

Returns

YooAsset.AllAssetsHandle: 返回全资源操作句柄

Parameters

TypeNameDescriptionSystem.Stringlocation资源的定位地址System.Typetype子对象类型

LoadAllAssetsSync(string)

同步加载资源包内所有资源对象

View Source

Declaration

public AllAssetsHandle LoadAllAssetsSync(string location)

Returns

YooAsset.AllAssetsHandle: 返回全资源操作句柄

Parameters

TypeNameDescriptionSystem.Stringlocation资源的定位地址

LoadAllAssetsAsync(AssetInfo, uint)

加载资源包内所有资源对象

View Source

Declaration

public AllAssetsHandle LoadAllAssetsAsync(AssetInfo assetInfo, uint priority = 0)

Returns

YooAsset.AllAssetsHandle: 返回全资源操作句柄

Parameters

TypeNameDescriptionYooAsset.AssetInfoassetInfo资源信息System.UInt32priority加载的优先级

LoadAllAssetsAsync(string, uint)

加载资源包内所有资源对象

View Source

Declaration

public AllAssetsHandle LoadAllAssetsAsync<TObject>(string location, uint priority = 0) where TObject : Object

Returns

YooAsset.AllAssetsHandle: 返回全资源操作句柄

Parameters

TypeNameDescriptionSystem.Stringlocation资源的定位地址System.UInt32priority加载的优先级

Type Parameters

NameDescriptionTObject资源类型

LoadAllAssetsAsync(string, Type, uint)

加载资源包内所有资源对象

View Source

Declaration

public AllAssetsHandle LoadAllAssetsAsync(string location, Type type, uint priority = 0)

Returns

YooAsset.AllAssetsHandle: 返回全资源操作句柄

Parameters

TypeNameDescriptionSystem.Stringlocation资源的定位地址System.Typetype子对象类型System.UInt32priority加载的优先级

LoadAllAssetsAsync(string, uint)

加载资源包内所有资源对象

View Source

Declaration

public AllAssetsHandle LoadAllAssetsAsync(string location, uint priority = 0)

Returns

YooAsset.AllAssetsHandle: 返回全资源操作句柄

Parameters

TypeNameDescriptionSystem.Stringlocation资源的定位地址System.UInt32priority加载的优先级

EnsureBundleFileAsync(EnsureBundleFileOptions)

确保资源包文件已就绪

View Source

Declaration

public EnsureBundleFileOperation EnsureBundleFileAsync(EnsureBundleFileOptions options)

Returns

YooAsset.EnsureBundleFileOperation: 返回确保资源包文件就绪的操作对象

Parameters

TypeNameDescriptionYooAsset.EnsureBundleFileOptionsoptions确保资源包文件已就绪的选项

LoadBundleFileSync(AssetInfo)

同步加载资源包文件

View Source

Declaration

public BundleFileHandle LoadBundleFileSync(AssetInfo assetInfo)

Returns

YooAsset.BundleFileHandle: 返回资源包文件操作句柄

Parameters

TypeNameDescriptionYooAsset.AssetInfoassetInfo资源信息

LoadBundleFileSync(string)

同步加载资源包文件

View Source

Declaration

public BundleFileHandle LoadBundleFileSync(string location)

Returns

YooAsset.BundleFileHandle: 返回资源包文件操作句柄

Parameters

TypeNameDescriptionSystem.Stringlocation资源的定位地址

LoadBundleFileAsync(AssetInfo, uint)

异步加载资源包文件

View Source

Declaration

public BundleFileHandle LoadBundleFileAsync(AssetInfo assetInfo, uint priority = 0)

Returns

YooAsset.BundleFileHandle: 返回资源包文件操作句柄

Parameters

TypeNameDescriptionYooAsset.AssetInfoassetInfo资源信息System.UInt32priority加载的优先级

LoadBundleFileAsync(string, uint)

异步加载资源包文件

View Source

Declaration

public BundleFileHandle LoadBundleFileAsync(string location, uint priority = 0)

Returns

YooAsset.BundleFileHandle: 返回资源包文件操作句柄

Parameters

TypeNameDescriptionSystem.Stringlocation资源的定位地址System.UInt32priority加载的优先级

CreateResourceDownloader(ResourceDownloaderOptions)

创建资源下载器,用于下载指定的资源标签关联的资源包文件。

View Source

Declaration

public ResourceDownloaderOperation CreateResourceDownloader(ResourceDownloaderOptions options)

Returns

YooAsset.ResourceDownloaderOperation: 返回资源下载操作对象

Parameters

TypeNameDescriptionYooAsset.ResourceDownloaderOptionsoptions资源下载选项

CreateResourceDownloader(BundleDownloaderOptions)

创建资源下载器,用于下载指定的资源信息列表依赖的资源包文件。

View Source

Declaration

public ResourceDownloaderOperation CreateResourceDownloader(BundleDownloaderOptions options)

Returns

YooAsset.ResourceDownloaderOperation: 返回资源下载操作对象

Parameters

TypeNameDescriptionYooAsset.BundleDownloaderOptionsoptions资源下载选项

CreateResourceUnpacker(ResourceUnpackerOptions)

创建内置资源解压器,用于解压指定的资源标签关联的资源包文件。

View Source

Declaration

public ResourceUnpackerOperation CreateResourceUnpacker(ResourceUnpackerOptions options)

Returns

YooAsset.ResourceUnpackerOperation: 返回资源解压操作对象

Parameters

TypeNameDescriptionYooAsset.ResourceUnpackerOptionsoptions资源解压选项

CreateResourceImporter(BundleImporterOptions)

创建资源导入器

View Source

Declaration

public ResourceImporterOperation CreateResourceImporter(BundleImporterOptions options)

Returns

YooAsset.ResourceImporterOperation: 返回资源导入操作对象

Parameters

TypeNameDescriptionYooAsset.BundleImporterOptionsoptions资源导入选项

Class ResourceUnpackerOperation

资源解压操作类

Assembly: YooAsset.dll
View Source

Declaration

public sealed class ResourceUnpackerOperation : DownloaderOperation, IEnumerator, IComparable<AsyncOperationBase>

Implements

  • System.Collections.IEnumerator

  • System.IComparable<YooAsset.AsyncOperationBase>


Struct ResourceUnpackerOptions

资源解压的操作选项

Assembly: YooAsset.dll
View Source

Declaration

public readonly struct ResourceUnpackerOptions

Properties

MaximumConcurrency

最大并发数量

View Source

Declaration

public int MaximumConcurrency { get; }

RetryCount

失败后的重试次数

View Source

Declaration

public int RetryCount { get; }

Tags

资源标签列表

View Source

Declaration

public string[] Tags { get; }


Class SceneHandle

场景句柄,用于管理场景的加载、激活和卸载。

Assembly: YooAsset.dll
View Source

Declaration

public sealed class SceneHandle : HandleBase, IEnumerator, IDisposable

Properties

SceneName

场景名称

View Source

Declaration

public string SceneName { get; }

SceneObject

场景对象

View Source

Declaration

public Scene SceneObject { get; }

Methods

ActivateScene()

激活场景(当同时存在多个场景时用于切换激活场景)

View Source

Declaration

public bool ActivateScene()

Returns

System.Boolean: 是否成功激活场景### AllowSceneActivation() 允许场景激活

View Source

Declaration

public bool AllowSceneActivation()

Returns

System.Boolean: 是否成功执行### UnloadSceneAsync() 卸载场景对象

View Source

Declaration

public UnloadSceneOperation UnloadSceneAsync()

Returns

YooAsset.UnloadSceneOperation: 卸载场景操作## Events

Completed

当加载完成时触发

View Source

Declaration

public event Action<SceneHandle> Completed

Event Type

System.Action<YooAsset.SceneHandle>

Implements

  • System.Collections.IEnumerator

  • System.IDisposable


Class SubAssetsHandle

子资源句柄,用于管理资源包内子资源对象的加载和访问。

Assembly: YooAsset.dll
View Source

Declaration

public sealed class SubAssetsHandle : HandleBase, IEnumerator, IDisposable

Properties

SubAssetObjects

子资源对象集合

View Source

Declaration

public IReadOnlyList<Object> SubAssetObjects { get; }

Methods

WaitForAsyncComplete()

等待异步执行完毕

View Source

Declaration

public void WaitForAsyncComplete()

GetSubAssetObject(string)

获取子资源对象

View Source

Declaration

public TObject GetSubAssetObject<TObject>(string assetName) where TObject : Object

Returns

<TObject>: 匹配的子资源对象,未找到则返回 null。

Parameters

TypeNameDescriptionSystem.StringassetName子资源对象名称

Type Parameters

NameDescriptionTObject子资源对象类型

GetSubAssetObjects()

获取所有的子资源对象集合

View Source

Declaration

public IReadOnlyList<TObject> GetSubAssetObjects<TObject>() where TObject : Object

Returns

System.Collections.Generic.IReadOnlyList<<TObject>>: 匹配类型的子资源对象集合##### Type Parameters

NameDescriptionTObject子资源对象类型

Events

Completed

当加载完成时触发

View Source

Declaration

public event Action<SubAssetsHandle> Completed

Event Type

System.Action<YooAsset.SubAssetsHandle>

Implements

  • System.Collections.IEnumerator

  • System.IDisposable


Delegate UnityWebRequestCreator

自定义 UnityWebRequest 创建委托

Assembly: YooAsset.dll
View Source

Declaration

public delegate UnityWebRequest UnityWebRequestCreator(string url, string method)


Class UnloadAllAssetsOperation

卸载所有资源的异步操作

Assembly: YooAsset.dll
View Source

Declaration

public sealed class UnloadAllAssetsOperation : AsyncOperationBase, IEnumerator, IComparable<AsyncOperationBase>

Methods

InternalStart()

内部启动方法(子类必须实现)

View Source

Declaration

protected override void InternalStart()

InternalUpdate()

内部更新方法(子类必须实现)

View Source

Declaration

protected override void InternalUpdate()

Implements

  • System.Collections.IEnumerator

  • System.IComparable<YooAsset.AsyncOperationBase>


Struct UnloadAllAssetsOptions

卸载所有资源的操作选项

Assembly: YooAsset.dll
View Source

Declaration

public readonly struct UnloadAllAssetsOptions

Properties

ShouldReleaseHandles

是否释放所有资源句柄,防止卸载过程中触发完成回调。

View Source

Declaration

public bool ShouldReleaseHandles { get; }

ShouldLockLoading

是否在卸载过程中锁定加载操作,防止新的任务请求。

View Source

Declaration

public bool ShouldLockLoading { get; }


Class UnloadSceneOperation

场景卸载异步操作类

Assembly: YooAsset.dll
View Source

Declaration

public sealed class UnloadSceneOperation : AsyncOperationBase, IEnumerator, IComparable<AsyncOperationBase>

Methods

InternalStart()

内部启动方法(子类必须实现)

View Source

Declaration

protected override void InternalStart()

InternalUpdate()

内部更新方法(子类必须实现)

View Source

Declaration

protected override void InternalUpdate()

InternalGetDescription()

获取操作的描述信息(子类可选实现)

View Source

Declaration

protected override string InternalGetDescription()

Returns

System.String: 操作的描述字符串,默认返回空字符串。

Implements

  • System.Collections.IEnumerator

  • System.IComparable<YooAsset.AsyncOperationBase>


Class UnloadUnusedAssetsOperation

卸载未使用资源的异步操作

Assembly: YooAsset.dll
View Source

Declaration

public sealed class UnloadUnusedAssetsOperation : AsyncOperationBase, IEnumerator, IComparable<AsyncOperationBase>

Methods

InternalStart()

内部启动方法(子类必须实现)

View Source

Declaration

protected override void InternalStart()

InternalUpdate()

内部更新方法(子类必须实现)

View Source

Declaration

protected override void InternalUpdate()

InternalWaitForCompletion()

内部同步等待方法(子类可选实现)

View Source

Declaration

protected override void InternalWaitForCompletion()

InternalGetDescription()

获取操作的描述信息(子类可选实现)

View Source

Declaration

protected override string InternalGetDescription()

Returns

System.String: 操作的描述字符串,默认返回空字符串。

Implements

  • System.Collections.IEnumerator

  • System.IComparable<YooAsset.AsyncOperationBase>


Struct UnloadUnusedAssetsOptions

卸载未使用资源的操作选项

Assembly: YooAsset.dll
View Source

Declaration

public readonly struct UnloadUnusedAssetsOptions

Properties

MaxLoopCount

最大循环迭代次数

View Source

Declaration

public int MaxLoopCount { get; }


Class WebPlayModeOptions

WebGL运行模式的操作选项

Assembly: YooAsset.dll
View Source

Declaration

public class WebPlayModeOptions : InitializePackageOptions

Properties

WebServerFileSystemParameters

Web 服务器文件系统初始化参数

View Source

Declaration

public FileSystemParameters WebServerFileSystemParameters { get; set; }

WebNetworkFileSystemParameters

Web 网络文件系统初始化参数

View Source

Declaration

public FileSystemParameters WebNetworkFileSystemParameters { get; set; }


Class YooAssetConfiguration

提供 YooAsset 全局配置的访问入口

Assembly: YooAsset.dll
View Source

Declaration

public static class YooAssetConfiguration

Methods

GetYooFolderName()

获取资源包裹的根文件夹名称

View Source

Declaration

public static string GetYooFolderName()

Returns

System.String: 文件夹名称。如果未配置则返回默认值 "yoo"。### GetBuildReportFileName(string, string) 获取构建报告的文件名

View Source

Declaration

public static string GetBuildReportFileName(string packageName, string packageVersion)

Returns

System.String: 包含 .report 扩展名的文件名

Parameters

TypeNameDescriptionSystem.StringpackageName包裹名称System.StringpackageVersion包裹版本号

GetManifestBinaryFileName(string, string)

获取清单二进制文件的文件名

View Source

Declaration

public static string GetManifestBinaryFileName(string packageName, string packageVersion)

Returns

System.String: 包含 .bytes 扩展名的文件名

Parameters

TypeNameDescriptionSystem.StringpackageName包裹名称System.StringpackageVersion包裹版本号

GetManifestJsonFileName(string, string)

获取清单 JSON 文件的文件名

View Source

Declaration

public static string GetManifestJsonFileName(string packageName, string packageVersion)

Returns

System.String: 包含 .json 扩展名的文件名

Parameters

TypeNameDescriptionSystem.StringpackageName包裹名称System.StringpackageVersion包裹版本号

GetPackageHashFileName(string, string)

获取包裹的哈希校验文件名

View Source

Declaration

public static string GetPackageHashFileName(string packageName, string packageVersion)

Returns

System.String: 包含 .hash 扩展名的文件名

Parameters

TypeNameDescriptionSystem.StringpackageName包裹名称System.StringpackageVersion包裹版本号

GetPackageVersionFileName(string)

获取包裹的版本记录文件名

View Source

Declaration

public static string GetPackageVersionFileName(string packageName)

Returns

System.String: 包含 .version 扩展名的文件名

Parameters

TypeNameDescriptionSystem.StringpackageName包裹名称

Class YooAssets

资源系统的主入口

Assembly: YooAsset.dll
View Source

Declaration

public static class YooAssets

Properties

IsInitialized

是否已经初始化

View Source

Declaration

public static bool IsInitialized { get; }

Methods

Initialize()

初始化资源系统

View Source

Declaration

public static void Initialize()

Initialize(ILogger)

初始化资源系统

View Source

Declaration

public static void Initialize(ILogger logger)

Parameters

TypeNameDescriptionYooAsset.ILoggerlogger自定义日志处理

Destroy()

销毁资源系统

View Source

Declaration

public static void Destroy()

CreatePackage(string)

创建资源包裹

View Source

Declaration

public static ResourcePackage CreatePackage(string packageName)

Returns

YooAsset.ResourcePackage: 新创建的资源包裹实例

Parameters

TypeNameDescriptionSystem.StringpackageName包裹名称

CreatePackage(string, uint)

创建资源包裹

View Source

Declaration

public static ResourcePackage CreatePackage(string packageName, uint packagePriority)

Returns

YooAsset.ResourcePackage: 新创建的资源包裹实例

Parameters

TypeNameDescriptionSystem.StringpackageName包裹名称System.UInt32packagePriority包裹优先级(值越大越优先更新)

GetPackage(string)

获取资源包裹

View Source

Declaration

public static ResourcePackage GetPackage(string packageName)

Returns

YooAsset.ResourcePackage: 指定名称的资源包裹实例

Parameters

TypeNameDescriptionSystem.StringpackageName包裹名称

TryGetPackage(string, out ResourcePackage)

尝试获取资源包裹

View Source

Declaration

public static bool TryGetPackage(string packageName, out ResourcePackage package)

Returns

System.Boolean: 如果资源包裹存在返回true否则返回false。

Parameters

TypeNameDescriptionSystem.StringpackageName包裹名称YooAsset.ResourcePackagepackage获取到的资源包裹如果不存在则为null。

GetPackages()

获取所有资源包裹

View Source

Declaration

public static IReadOnlyList<ResourcePackage> GetPackages()

Returns

System.Collections.Generic.IReadOnlyList<YooAsset.ResourcePackage>: 当前已注册的所有资源包裹的只读列表### RemovePackage(string) 移除资源包裹

View Source

Declaration

public static void RemovePackage(string packageName)

Parameters

TypeNameDescriptionSystem.StringpackageName包裹名称

ContainsPackage(string)

检测资源包裹是否存在

View Source

Declaration

public static bool ContainsPackage(string packageName)

Returns

System.Boolean: 如果资源包裹存在返回true否则返回false。

Parameters

TypeNameDescriptionSystem.StringpackageName包裹名称

SetAsyncOperationMaxTimeSlice(long)

设置异步系统参数,每帧执行消耗的最大时间切片。

View Source

Declaration

public static void SetAsyncOperationMaxTimeSlice(long milliseconds)

Parameters

TypeNameDescriptionSystem.Int64milliseconds最大时间切片(单位:毫秒),不能为负数。

Class YooException

Base exception for all YooAsset custom exceptions.

Assembly: YooAsset.dll
View Source

Declaration

[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

Declaration

[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

Declaration

[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

Declaration

[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

Declaration

[Serializable]
public class YooPackageInvalidException : YooException, ISerializable

Properties

PackageName

Gets the name of the package that caused the exception.

View Source

Declaration

public string PackageName { get; }

Implements

  • System.Runtime.Serialization.ISerializable