# Unity 桥接

World Creator 为 Unity 提供的桥接工具可让您轻松将地形创作导入到 Unity 中以用于游戏项目。

## **安装**

在 Unity 中导入下载的桥接文件中的 .unitypackage，可通过菜单 Assets/Import Package/Custom Package... 或将其拖放到 Unity 的 Project 视图中来导入。

要访问桥接对话框，请导航到 Window/World Creator Bridge。

## **参数**

* **选择桥接 .xml 文件**

  定位所需同步项目的 .xml 文件。对于 WC 22 及以上版本，该文件默认位于 *\[User]*\Documents\World Creator\Sync\\

* **地形资源名称**

  指定桥接创建的所有地形 GameObject 的前缀。

* **删除未使用的资源**

  未使用的资源将在同步时自动删除。

* **导入图层**

  在生成的材质中切换使用单独的地形图层或烘焙的颜色贴图。

* **分割阈值**

  设置 Unity 中地形切片的网格大小。增大分割阈值会减少切片数量。

* **世界缩放**

  指定地形的缩放因子。

* **材质类型**

  选择您 Unity 项目的渲染管线或使用自定义材质。

## **工作流程示例**

在此示例中，我们将把地形传输到 Unity。将使用随 World Creator 提供的 Canyon 示例文件。这些步骤可应用于任何其他 World Creator 项目。

### **从 World Creator 同步**

单击主面板顶部应用程序栏中的同步按钮，自动导出 World Creator 中的所有必要数据。

<figure><img src="/files/b6dd48085a6c2149af440a4bc00e2873de867e11" alt=""><figcaption><p><em>同步前的 World Creator 场景</em></p></figcaption></figure>

### **同步到 Unity**

在 **Window/World Creator Bridge**下，打开桥接对话窗口。

根据项目的渲染管线选择适当的 **材质类型** 对于我们的情况，由于我们使用的是内置渲染管线，需要将其配置为 **Standard**.

按下 **Synchronize** 按钮后，地形将被加载到场景中。

<figure><img src="/files/615f3f4f5f3737615bd3a602bd5d55a90e981d52" alt=""><figcaption><p><em>已同步到 Unity 的地形</em></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.world-creator.com/zh/can-kao/export/bridge-tools/unity-bridge.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.
