> ## Documentation Index
> Fetch the complete documentation index at: https://docs.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 属性一样指定默认安装哪些内容。

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

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

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

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

游戏可通过调用 [XPackageUninstallChunks](https://docs.xbox.com/zh-CN/reference/system/xpackage/functions/xpackageuninstallchunks.md) 方法卸载 OnDemand 内容。

## 参考 API 文档

* [XPackage（API 目录）](https://docs.xbox.com/zh-CN/reference/system/xpackage/xpackage_members.md)
  * 函数
    * [XPackageInstallChunks](https://docs.xbox.com/zh-CN/reference/system/xpackage/functions/xpackageinstallchunks.md)
    * [XPackageUninstallChunks](https://docs.xbox.com/zh-CN/reference/system/xpackage/functions/xpackageuninstallchunks.md)

## 另请参阅

[Intelligent Delivery](https://docs.xbox.com/zh-CN/build/core-features/common/packaging/overviews/intelligentdelivery.md)


## Related topics

- [XPackageUninstallChunks](https://docs.xbox.com/zh-CN/reference/system/xpackage/functions/xpackageuninstallchunks.md)
- [XPackageInstallChunks](https://docs.xbox.com/zh-CN/reference/system/xpackage/functions/xpackageinstallchunks.md)
- [经测试的 XBOX 要求](https://docs.xbox.com/zh-CN/publishing/certification/console-cert-tested-requirements.md)
- [Intelligent Delivery](https://docs.xbox.com/zh-CN/build/core-features/common/packaging/overviews/intelligentdelivery.md)
- [流式安装:状态](https://docs.xbox.com/zh-CN/build/core-features/common/packaging/packaging-installstatus.md)
