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資產(chǎn)組織成組并構(gòu)建為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使用引用計數(shù)系統(tǒng)來確保在需要時僅將資產(chǎn)保留在內(nèi)存中。有關(guān)引用計數(shù)的更多信息以及如何最大程度地減少資產(chǎn)在任何給定時間占用的內(nèi)存量,請參見內(nèi)存管理。
Addressables provides several options and APIs for loading and instantiating Addressable assets. See?Loading Addressable assets?for information and examples, including:
譯:Addressables為加載和實例化Addressable資產(chǎn)提供了幾個選項和API。有關(guān)信息和示例,請參見加載Addressable資產(chǎn),包括:
Loading an single asset譯:加載單個資產(chǎn)
Loading multiple assets譯:加載多個資產(chǎn)
Loading an AssetReference譯:加載AssetReference
Loading Scenes譯:加載場景
Loading assets by location譯:按位置加載資源
Instantiating objects from Addressables譯:從Addressables實例化對象
Releasing Addressable assets譯:釋放Addressable資產(chǎn)
Using Addressables in a Scene譯:在場景中使用Addressables
Downloading dependencies in advance譯:預(yù)先下載依賴項
Addressables uses asynchronous operations for most loading tasks. See?Operations?for information on how to handle operations in your code, including:
譯:Addressables對大多數(shù)加載任務(wù)使用異步操作。請參見操作以了解如何在代碼中處理操作,包括:
Releasing AsyncOperationHandle instances譯:釋放AsyncOperationHandle實例
Coroutine- and IEnumerator-based operation handling譯:基于Coroutine和IEnumerator的操作處理
Event-based operation handling譯:基于事件的操作處理
Task-based operation handling譯:基于任務(wù)的操作處理
Using operations synchronously譯:同步使用操作
Custom operations譯:自定義操作
Using typed versus untyped operation handles譯:使用類型化與非類型化操作句柄
Reporting operation progress譯:報告操作進度
See the following for information about other runtime topics:
譯:有關(guān)其他運行時主題的信息,請參見以下內(nèi)容:
Customizing initialization譯:自定義初始化
Loading additional catalogs譯:加載額外的目錄
Updating catalogs譯:更新目錄
Modifying resource URLs at runtime譯:在運行時修改資源URL
Getting the address of an asset at runtime譯:在運行時獲取資產(chǎn)地址