---
title: 使用脚本创建组件
product: Unity Editor
version: '6000.0'
latest_version: '7000.0'
status: This page documents version 6000.0. The latest version is 7000.0.
canonical: https://docs.unity.com/zh-cn/engine/6000.0/manual/working-with-gameobjects/unity-components/creating-components
latest_url: https://docs.unity.com/zh-cn/engine/7000.0/manual/working-with-gameobjects/unity-components/creating-components.md
last_updated: 2026-09-14
generated_at: 2026-11-16T19:12:22.720Z
locale: zh-cn
---

# 使用脚本创建组件

> 学习使用脚本创建组件。

组件为游戏对象添加功能。要在 Editor 中自定义和添加到组件，可以编写自己的脚本。

要使用脚本创建组件，您需要编写脚本，然后将脚本附加到游戏对象。游戏对象所挂的脚本会显示在游戏对象的 Inspector 窗口中，因为 Editor 将它们视为内置组件。

ON 如何创建脚本的信息，请参阅[创建和使用脚本](/engine/6000.0/manual/scripting/get-started/creating-scripts.md)。

## 其他资源##additional-resources

* [组件](https://docs.unity3d.com/ScriptReference/Component.html)脚本 API Page。

* [使用组件](/engine/6000.0/manual/working-with-gameobjects/unity-components/using-components.md)。
