# 預製體

"預製體/prefab"（簡稱"預製物"）指的是一個可重複使用且預先配置的物件，它封裝了內部物件、組件和配置的組合。預製體旨在簡化和優化創建和管理遊戲內容的過程。與其多次重新創建具有相同屬性的相同物件，您可以創建預製體作為常用元素的模板，例如角色、物品或環境物件。

## 製作預製體

您可以從已存在的一組物件創建預製體，或創建一個新的預製體。

### 選擇創建

如果您在場景中已經有一個或多個想要製作成可重複使用的預製體的物件，您可以將它們組合在一起（shift+G），然後在大綱視圖中右鍵點擊該組，選擇"轉換為預製體/Convert into a prefab"。該組的名稱將成為預製體資產的名稱。您場景中的組將被預製體物件替換。

<figure><img src="/files/B8oEhMSu3mrxV1FksTd4" alt="Convert to a prefab"><figcaption><p>Convert to a prefab from outliner</p></figcaption></figure>

### 從資產瀏覽器創建

您也可以通過點擊"新增/Add new"在資產瀏覽器中創建一個新的空預製體。系統會提示您為預製體資產輸入一個名稱。

<figure><img src="/files/JcieAO7mzvhb5RAZWZcF" alt=""><figcaption><p>Create a new empty prefab</p></figcaption></figure>

## 編輯預製體

可以通過打開預製體編輯器來編輯預製體，方法是在大綱視圖中選擇預製體實例或從資產瀏覽器中選擇。打開預製體編輯器，您可以對預製體內的任何物件進行任何更改，也可以添加額外的物件。保存預製體（ctrl+S）後，對預製體的更改將自動更新到使用它的任何場景中。

<figure><img src="/files/3cRjYNvFNacRwqkyNiaN" alt=""><figcaption><p>Open prefab editor</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hology.app/zh-tw/assets/yu-zhi-ti.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
