Unity_Addressable_Using Addressables at runtime(运行期间使用Addressabl
Once you have your Addressable assets organized into groups and built into AssetBundles, you must still load, instantiate, and, in the end release them at runtime.
译:一旦您将Addressable资产组织成组并构建为AssetBundles,您仍然必须在运行时加载、实例化和最终释放它们。
Addressables uses a reference counting system to make sure that assets are only kept in memory while they are needed. See Memory management for more information about reference counting and how you can minimize the amount of memory used by assets at any given time.
译:Addressables使用引用计数系统来确保在需要时仅将资产保留在内存中。有关引用计数的更多信息以及如何最大程度地减少资产在任何给定时间占用的内存量,请参见内存管理。
Addressables provides several options and APIs for loading and instantiating Addressable assets. See Loading Addressable assets for information and examples, including:
译:Addressables为加载和实例化Addressable资产提供了几个选项和API。有关信息和示例,请参见加载Addressable资产,包括:
Loading an single asset译:加载单个资产
Loading multiple assets译:加载多个资产
Loading an AssetReference译:加载AssetReference
Loading Scenes译:加载场景
Loading assets by location译:按位置加载资源
Instantiating objects from Addressables译:从Addressables实例化对象
Releasing Addressable assets译:释放Addressable资产
Using Addressables in a Scene译:在场景中使用Addressables
Downloading dependencies in advance译:预先下载依赖项
Addressables uses asynchronous operations for most loading tasks. See Operations for information on how to handle operations in your code, including:
译:Addressables对大多数加载任务使用异步操作。请参见操作以了解如何在代码中处理操作,包括:
Releasing AsyncOperationHandle instances译:释放AsyncOperationHandle实例
Coroutine- and IEnumerator-based operation handling译:基于Coroutine和IEnumerator的操作处理
Event-based operation handling译:基于事件的操作处理
Task-based operation handling译:基于任务的操作处理
Using operations synchronously译:同步使用操作
Custom operations译:自定义操作
Using typed versus untyped operation handles译:使用类型化与非类型化操作句柄
Reporting operation progress译:报告操作进度
See the following for information about other runtime topics:
译:有关其他运行时主题的信息,请参见以下内容:
Customizing initialization译:自定义初始化
Loading additional catalogs译:加载额外的目录
Updating catalogs译:更新目录
Modifying resource URLs at runtime译:在运行时修改资源URL
Getting the address of an asset at runtime译:在运行时获取资产地址