> ## 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：OnDemand 內容

> Intelligent Delivery：OnDemand 內容

<Note>不再建議使用 OnDemand 屬性。您應該考慮改用功能和配方，將內容分組成可獨立新增和移除的群組。功能和配方仍可讓您指定預設要安裝的內容，就像 OnDemand 屬性一樣。</Note>

OnDemand 區塊可讓遊戲指定預設不安裝、但可在使用者要求時或遊戲呼叫 [XPackageInstallChunks](/zh-TW/reference/system/xpackage/functions/xpackageinstallchunks) 方法時安裝的內容。

若要將區塊指定為 OnDemand，請將 `OnDemand` 屬性套用至 layout.xml 檔案中的區塊，如下列範例所示。

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

包含 `OnDemand` 屬性的區塊也必須包含自訂標籤規範，讓執行階段 API 可以依標籤參照相關聯的區塊。

遊戲可以呼叫 [XPackageUninstallChunks](/zh-TW/reference/system/xpackage/functions/xpackageuninstallchunks) 方法來解除安裝 OnDemand 內容。

<a id="ID4EKB" />

## 參考 API 文件

* [XPackage (API 內容)](/zh-TW/reference/system/xpackage/xpackage_members)
  * 函式
    * [XPackageInstallChunks](/zh-TW/reference/system/xpackage/functions/xpackageinstallchunks)
    * [XPackageUninstallChunks](/zh-TW/reference/system/xpackage/functions/xpackageuninstallchunks)

## 另請參閱

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


## Related topics

- [Intelligent Delivery](/zh-TW/build/core-features/common/packaging/overviews/intelligentdelivery.md)
- [XPackageInstallChunks](/zh-TW/reference/system/xpackage/functions/xpackageinstallchunks.md)
- [XPackageUninstallChunks](/zh-TW/reference/system/xpackage/functions/xpackageuninstallchunks.md)
- [Intelligent Delivery：自訂標記指定元](/zh-TW/build/core-features/common/packaging/intelligentdelivery-custom.md)
- [Intelligent Delivery：裝置規範](/zh-TW/build/core-features/common/packaging/intelligentdelivery-device.md)
