Unity3D说明文档翻译-Creating Components

了解如何在Unity中通过创建脚本来生成组件。脚本在Unity中被视为一种特定类型的组件,可以自定义其在检视面板上的属性,并实现所需的功能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Creating Components

创建组件

When you create a script and attach it to a GameObject, the script appears in the GameObject’s Inspector just like a Component. This is because scripts become Components when they are saved - a script is just a specific type of Component. In technical terms, a script compiles as a type of Component, and is treated like any other Component by the Unity engine. So basically, a script is a Component that you are creating yourself. You will define its members to be exposed in the Inspector, and it will execute whatever functionality you’ve written.

当你创建一个脚本并附加到一个游戏对象上,脚本将显示在对象的检视面板上就像一个组件.这是因为当脚本被保存时脚本变成了组件-一个脚本仅是一个特定类型的组件.在专业术语中,一个脚本编译为一个组件类型,并被Unity引擎视为和任何其他组件一样.所以本质上,一个脚本就是一个组件.你可以定义它的成员来在检视面板上暴露,和它将执行些什么功能.

Read more about creating and using scripts the Scripting section of the manual.

阅读更多关于创建和使用脚本,查看手册的脚本部分.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值