> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Intelligent Delivery：自定义标签修饰符

> Intelligent Delivery：自定义标签修饰符

自定义标签修饰符可将若干 chunk 标记为相关。自定义标签的主要用途是将 chunk 分组以纳入 [Features](/build/core-features/common/packaging/intelligentdelivery-features-recipes)。

<a id="ID4EV" />

```xml theme={null}
<Chunk Id="7000" Tags="LevelEditor">  
```

## 对相关 chunk 进行分组

使用自定义标签修饰符将若干 chunk 标记为相关。这简化了检查运行游戏所需的所有 chunk 是否都在用户主机上的过程。

例如，你无需判断 Level 1 的资产是否分别包含在 chunk 1000、1001 和 1002 中，也无需调用 [XPackageFindChunkAvailability](/reference/system/xpackage/functions/xpackagefindchunkavailability) 方法来判断 Level 1 是否已完全安装并可玩，你可以将这三个 chunk 都打上自定义标签 “Level 1”。然后使用 [XPackageChunkSelector](/reference/system/xpackage/structs/xpackagechunkselector) 调用 [XPackageFindChunkAvailability](/reference/system/xpackage/functions/xpackagefindchunkavailability) 方法，即可轻松获取该数据集合的安装状态。

<a id="ID4EHB" />

## 仅在多个特性同时启用时安装的 chunk

可以在一个 chunk 中表达多个自定义标签修饰符，使该 chunk 仅在包含这两个标签的 Features 都启用时才安装。通过使用 # 符号将两个标签连接起来来实现。

Chunk 8000 仅在同时存在包含 campaign 标签的活动特性以及包含 hd 标签的活动特性时才会安装。如果用户卸载 campaign Feature 或 HD Texture Feature，Chunk 8000 将随所移除的 Feature 中所含标签相关的 chunk 一并移除。

```xml theme={null}
<Features>
  <Feature Id="campaign_feature_id" DisplayName="Campaign" Tags="campaign"/>
  <Feature Id="hd_feature_id" DisplayName="HD Textures" Tags="hd"/>
</Features>

<Chunk Id="8000" Tags="campaign#hd">  <!-- This chunk is only installed if both the Campaign and HD Textures Features are active -->
<Chunk Id="8001" Tags="campaign">
<Chunk Id="8002" Tags="hd">
<Chunk Id="8003" Tags="campaign;hd">  <!-- This chunk is only installed if either the Campaign or the HD Textures Features are active -->
```

## 从光盘生产用的包中省略内容

可以使用标签修饰符指定某些内容不应包含在光盘上的包中。例如，如果你的游戏占用 65 GB 的磁盘空间，那么诸如 20 GB 的幕后花絮视频等可选内容对于单张 BD50 蓝光光盘来说过大。

使用自定义标签修饰符指定包中某些内容默认不安装。例如可将某个 chunk 指定为 OnDemand，仅当游戏请求时才安装。为便于在运行时下载这样的可选 OnDemand chunk，还可在 layout.xml 文件中用自定义标签修饰符标记它。你的游戏可通过在传递给 [XPackageInstallChunks](/reference/system/xpackage/functions/xpackageinstallchunks) API 的 [XPackageChunkSelector](/reference/system/xpackage/structs/xpackagechunkselector) 中设置该自定义标签，从 XBOX Live 请求下载该内容。

<a id="ID4EYB" />

## 多光盘游戏

对于多光盘发行，使用标签修饰符指定内容放置在哪张光盘上。例如，可以将所有多人内容放在编译光盘的第 2 张光盘上。

或者，为不同地区生产多光盘 SKU 时，可用此特性将 EFIGS 放在一张蓝光光盘 SKU 上，将日语放在另一张 SKU 上（例如用于母带制作和复制），同时仅上传和管理单个 XVC 镜像。

<a id="ID4E6B" />

## 参考 API 文档

* [XPackage（API 目录）](/reference/system/xpackage/xpackage_members)
  * 函数
    * [XPackageFindChunkAvailability](/reference/system/xpackage/functions/xpackagefindchunkavailability)
    * [XPackageInstallChunks](/reference/system/xpackage/functions/xpackageinstallchunks)
  * 结构体
    * [XPackageChunkSelector](/reference/system/xpackage/structs/xpackagechunkselector)

## 另请参阅

[Intelligent Delivery](/build/core-features/common/packaging/overviews/intelligentdelivery)


## Related topics

- [Intelligent Delivery](/zh-CN/build/core-features/common/packaging/overviews/intelligentdelivery.md)
- [Intelligent Delivery：按需内容](/zh-CN/build/core-features/common/packaging/intelligentdelivery-ondemand.md)
- [Intelligent Delivery：设备修饰符](/zh-CN/build/core-features/common/packaging/intelligentdelivery-device.md)
- [针对 PC 的 MSIXVC2 打包入门](/zh-CN/build/core-features/common/packaging/overviews/packaging-getting-started-for-PC-msixvc2.md)
- [Intelligent Delivery：features 与 recipes](/zh-CN/build/core-features/common/packaging/intelligentdelivery-features-recipes.md)
