欢迎光临散文网 会员登陆 & 注册

Unity_Addressable_组设置

2023-03-31 00:32 作者:unity_某某师_高锦锦  | 我要投稿

Group settings determine how Unity treats the assets in a group in content builds. Group settings control properties such as the location where AssetBundles are built or bundle compression settings.

译:组设置确定Unity在内容构建中处理组中资产的方式。组设置控制属性,例如构建AssetBundles的位置或捆绑压缩设置。

A group's settings are declared in Schema objects attached to the group. When you create a group with the Packed Assets template, the Content Packing & Loading and Content Update Restriction schemas define the settings for the group. The default Build scripts expect these settings.

译:组的设置在附加到组的模式对象中声明。当您使用Packed Assets模板创建组时,Content Packing&Loading和Content Update Restriction模式定义组的设置。默认构建脚本期望这些设置。


The Inspector window for the Default Local Group

译:默认本地组的检查器窗口

NOTE

If you create a group with the Blank template, then no schemas are attached to the group. Assets in such a group cannot be processed by the default build scripts.

译:如果使用空模板创建组,则未附加模式对象到该组。此类组中的资产无法由默认构建脚本处理。

Schemas

A group schema is a ScriptableObject that defines a collection of settings for an Addressables group. You can assign any number of schemas to a group. The Addressables system defines a number of schemas for its own purposes. You can also create custom schemas to support your own build scripts and utilities.

译:组模式是一种ScriptableObject,用于为Addressables组定义一系列设置。您可以向组分配任意数量的模式。Addressables系统为其自身的目的定义了许多模式。您还可以创建自定义模式以支持自己的构建脚本和实用程序。

The built-in schemas include:内置模式包括:

  • Content Packing & Loading: this is the main Addressables schema used by the default build script and defines the settings for building and loading Addressable assets.译:Content Packing&Loading:这是默认构建脚本使用的主Addressables模式,并定义了构建和加载Addressable资产的设置。

  • Content Update Restrictions: defines settings for making differential updates of a previous build. See Builds for more information about update builds.译:Content Update Restrictions:定义了先前构建的差分更新的设置。有关更新构建的更多信息,请参见“构建”。

  • Resources and Built In Scenes: a special-purpose schema defining settings for which types of built-in assets to display in the Built In Data group.译:资源和内置场景:特殊用途的模式,定义了在内置数据组中显示哪些类型的内置资产的设置。

Defining custom schemas

To create your own schema, extend the AddressableAssetGroupSchema class (which is a kind of ScriptableObject).

译:要创建自己的模式,请扩展AddressableAssetGroupSchema类(这是一种ScriptableObject类型)。

Once you have defined your custom schema object, you can add it to existing groups and group templates using the Add Schema buttons found on the Inspector windows of those entities.

译:一旦定义了自定义模式对象,您可以使用在这些实体的检查器窗口上找到的Add Schema按钮将其添加到现有组和组模板中。

You might also want to create a custom Editor script to help users interact with your custom settings. See Custom Inspector scripts.

译:您可能还希望创建自定义编辑器脚本,以帮助用户与自定义设置交互。请参见自定义检查器脚本。

In a build script, you can access the schema settings for a group using its AddressableAssetGroup object.

译:在构建脚本中,您可以使用其AddressableAssetGroup对象访问组的模式设置。




Unity_Addressable_组设置的评论 (共 条)

分享到微博请遵守国家法律