7. Addressable asset settings

You can access the main Addressable system options on the Addressable Asset Settings  Inspector (menu: Window > Asset Management > Addressables > Settings  ).

The Addressables system stores settings assets in the AddressableSettingsData folder (under your project assets folder). If this folder does not exist yet, you must initialize the Addressables system from the Groups window (menu: Window > Asset Management > Addressables > Groups ).

Addressable Assets Settings Inspector

The Inspector consists of the following parts:

You can click the Manage Groups button to open the Groups window .

contour


Profile settings

Use the Active Profiles list to select the active profile. The active configuration file determines the variable values ​​used by the Addressables build script.

Click the Manage Profiles button to open the Profiles window where you can create new profiles and change profile variables.

For more information on configuration files, see Configuration Files.

diagnosis


diagnostic settings

property Function
Send profiler events Enable profiler events. You must enable this setting to use the Addressables Event Viewer window.
Log runtime exceptions Log runtime exceptions for asset loading operations (in addition to logging errors to the AsyncOperationHandle.OperationException property).

enable all logging

By default, addressable assets only log warnings and errors. You can enable verbose logging by opening the Player settings window (menu: Edit  >  Project Settings...  >  Player ), navigating to the Other Settings  >  Configuration section, and  ADDRESSABLES_LOG_ALLadding " " to the Scripting Define Symbols field.

Table of contents


directory settings

Settings related to the Addressables Catalog, which maps an asset's address to its physical location.

property Function
Player Version Override Overrides the timestamp used to formulate the remote directory name. If set, the remote directory will be named Catalog_<Player Version Override>.json. If left blank, a timestamp is used. Note that when you use a unique remote directory name for each new build, you can host multiple versions of content on the same base URL. If you use the same override string for every build, then all players will load the new directory. Also note that player update builds always use the same remote directory name as the build they are updating (see Content update builds ).
zip local directory Build catalogs in compressed AssetBundle files.
Reduces the storage size of the catalog, but increases the time to build and load the catalog.
Optimize directory size Reduce the size of the directory by creating lookup tables for internal IDs. Can increase the time it takes to load a directory.

Content update


Content Update Settings

Settings that control remote content builds and updates.

property Function
Manually update catalogs only Disables automatic checks for updated remote directories when the Addressables system is initialized at runtime. You can check the update directory manually .
Content State Build Path Where to build the content state files generated by the default build scripts.
Create a remote directory Enable to build remote directories.
build and load path Where to build and load remote directories. Select a profile to select path pairs from the list, or choose <custom>if you want to set build and load paths separately.
Visible only when Build Remote Catalog is enabled .
build path Where to build the remote directory. In general, you should use the RemoteBuildPath  profile changeable. Only if you set Build & Load Paths
to .<custom>
load path Access the URL of the remote directory. In general, you should use the RemoteLoadPath  profile changeable. Only if you set Build & Load Paths
to .<custom>

download


download settings

Settings that affect catalog and AssetBundle download processing.

property Function
Custom certificate handler Classes for custom certificate handling. The list contains all classes extending UnityEngine.Networking.CertificateHandler in the project .
Maximum concurrent web requests The system queues any requests that exceed this limit. It is recommended to do 2-4 downloads at the same time to achieve the best download speed.
Directory download timed out The number of seconds to wait for the catalog file to download.

put up


build settings

A setting that affects all builds.

property Function
Build Addressables on Player Build Whether Unity builds Addressables content as part of the Player build.
Build Addressables content on Player Build : Addressables content is always built when the Player is built.
Do not build Addressables content on Player Build : Do not build Addressables content while building the Player. (If you modify the Addressables content, you must manually rebuild it before building the player.)
Use Global Settings (stored in Preferences): Use in the Unity Editor Preferences ( under Addressables ).

The first two options override the current project's global preferences and affect all contributors who build the project. Otherwise, the global preference value applies to all Unity projects. See Construction Content for more information.
ignore invalid/unsupported files in the build If enabled, the Addressables build script excludes invalid or unsupported files instead of aborting the build.
unique bundle id Whether to generate unique names for bundles per build. See Unique Bundle IDs for more information.
continuous beam Produces more efficient bundle layouts. If you have bundles generated by Addressables 1.12.1 or earlier, disable this option to minimize bundle changes.
non-recursive dependent computation Enabling this option can improve build times and reduce runtime memory overhead when assets have circular dependencies. Examples:
• A prefab assigned to Bundle A references a Material assigned to Bundle B. If this option is disabled, Unity needs to calculate the material's dependencies twice, once for each bundle. If this option is enabled, Unity only needs to calculate the material's dependencies once for Bundle B.
• Many scenes reference the same material. If this option is disabled, Unity will open each scene to calculate shader usage, which is an expensive operation. If this option is enabled, Unity only loads the material and does not need to open any scenes for dependency calculations.

This option is enabled by default when using Unity 2021.2 or later. Disabling this option invalidates previously built bundles, as rebuilt bundles will have a different build layout. Therefore, this option should remain enabled unless a build has already been delivered.

When this option is enabled, some circular dependencies may fail to load because referenced assets are always assigned to the same bundle location, even when more are added to the build. This problem usually occurs with Monoscripts. Building MonoScript packages (see MonoScript Package Naming Prefixes ) can help resolve these load failures.
shader package naming prefix How to name the packages generated for Unity shaders.
MonoScript package naming prefixes How to name the package that contains all of MonoScript. This package ensures that Unity loads all Monoscripts before any MonoBehaviors can reference them. It also reduces the number of duplicate or complex Monoscript dependencies, thus reducing runtime memory overhead.
从 AssetBundle 中剥离 Unity 版本 是否从包头中删除 Unity 版本。
禁用可见的子资产表示 如果您不直接使用子对象(Sprites、子网格等),启用此选项可缩短构建时间。

构建和播放模式脚本


配置的构建和播放模式脚本

配置项目中可用的IDataBuilder脚本。如果您创建自定义构建或播放模式脚本,则必须先将其添加到此列表,然后才能使用。

Addressables 包包含一些构建脚本,它们处理默认构建过程并提供不同的方式来访问您在播放模式下的数据。您可以在 AddressableAssetData/DataBuilders 文件夹中找到这些脚本。

笔记

构建和播放模式脚本是 ScriptableObject 资产。按照ScriptableObject 手册页中的说明为构建或播放模式脚本创建 ScriptableObject 资产。

要添加自定义脚本,请单击+按钮并从文件面板中选择代表所需脚本的 ScriptableObject 资产。

有关自定义脚本的更多信息,请参阅自定义构建脚本。

资产组模板


配置的组模板

定义可用于创建新组的模板列表。当您创建新模板时,您必须先将其添加到此列表中,然后才能使用它。

Addressables 包包含一个模板,其中包含默认构建脚本使用的模式。您可以在 AddressableAssetData/AssetGroupTemplates 文件夹中找到该模板。

笔记

组模板是 ScriptableObject 资产。按照ScriptableObject 手册页中的说明为组模板创建 ScriptableObject 资产。

To add a custom template, click the + button and select the ScriptableObject asset representing the desired template from the files panel.

For information on creating custom templates, see Group Templates.

list of initialization objects


Configuration initialization object

The initialization object for the configuration item. The initialization object is a ScriptableObject class that implements the IObjectInitializationDataProvider interface. You can create these objects to pass data to the Addressables initialization process at runtime.

notes

The initialization object is a ScriptableObject asset. Follow the instructions in the ScriptableObject man page to create a ScriptableObject asset for the initialization object.

To add an initialization object, click the + button and select the ScriptableObject asset representing the desired object from the files panel.

See Custom Initialization for details.

Guess you like

Origin blog.csdn.net/youmangu/article/details/129831657