> ## 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：按需内容

<Note>不再建议使用 OnDemand 属性。应改为考虑使用 Features 和 Recipes 将内容分组为可独立添加和移除的组。Features 和 Recipes 仍允许你像 OnDemand 属性一样指定默认安装哪些内容。</Note>

OnDemand chunk 允许游戏指定默认不安装、但可根据用户请求或游戏调用 [XPackageInstallChunks](/reference/system/xpackage/functions/xpackageinstallchunks) 方法时安装的内容。

要将 chunk 指定为 OnDemand，请在 layout.xml 文件中的 chunk 上应用 `OnDemand` 属性，如以下示例所示。

```xml theme={null}
<Chunk Id="6000" Tags="LevelEditor" OnDemand="true">  
```

包含 `OnDemand` 属性的 chunk 还必须包含自定义标签修饰符，以便运行时 API 通过标签引用相关 chunk。

游戏可通过调用 [XPackageUninstallChunks](/reference/system/xpackage/functions/xpackageuninstallchunks) 方法卸载 OnDemand 内容。

<a id="ID4EKB" />

## 参考 API 文档

* [XPackage（API 目录）](/reference/system/xpackage/xpackage_members)
  * 函数
    * [XPackageInstallChunks](/reference/system/xpackage/functions/xpackageinstallchunks)
    * [XPackageUninstallChunks](/reference/system/xpackage/functions/xpackageuninstallchunks)

## 另请参阅

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


## Related topics

- [XR-129 智能交付内容管理](/zh-CN/publishing/certification/xr/xr-129.md)
- [FMA:XR-129 智能分发内容管理](/zh-CN/publishing/certification/fma/xr-129.md)
- [XBOX 认证概览](/zh-CN/publishing/certification/overview.md)
- [Intelligent Delivery](/zh-CN/build/core-features/common/packaging/overviews/intelligentdelivery.md)
- [流式安装:状态](/zh-CN/build/core-features/common/packaging/packaging-installstatus.md)
