码迷,mamicode.com
首页 > 编程语言 > 详细

Unity3D脚本手册

时间:2016-05-07 01:08:47      阅读:203      评论:0      收藏:0      [点我收藏+]

标签:

翻译:脚本_树

This is a short overview of how scripting inside Unity works.

Scripting inside Unity consists of attaching custom script objects called behaviours to game objects. Different functions inside the script objects are called on certain events. The most used ones being the following:

这是一本关于脚本在Untiy中如何工作的简短概述。

脚本在Unity由附加自定义脚本对象到游戏对象构成。不同的函数在脚本对象内在特定事件被调用。以下最常用的:

Update:

This function is called before rendering a frame. This is where most game behaviour code goes, except physics code.

这个函数在运行一帧之前被调用,这是大部分的游戏行为代码在这里执行,除了物理代码。

FixedUpdate:

This function is called once every physics time step. This is the place to do physics-based game behaviour.

这个函数会在每个固定的物理时间步被调用一次。这是放置游戏基本物理行为代码的地方。

Code outside any function 函数外部代码 :

Code outside functions is run when the object is loaded. This can be used to initialise the state of the script.

  函数外部的代码在物体被加载时运行。这可以用来初始化脚本状态。

Note: Sections of this document assume you are using Javascript, but see Writing scripts in C# for information about how to use C# or Boo scripts. 
注意:这个文档假设你使用的是Javascript,否则请查看 Writing scripts in C# (用C#编写脚本)来获取如何使用C#或Boo编写脚本。

You can also define event handlers. These all have names starting with On, (i.e. OnCollisionEnter). To see the full list of predefined events, see the documentation forMonoBehaviour.

也可以使用事件处理程序,这些函数的名字都开始于On(类似的OnCollisionEnter),看所有的预定义事件列表,查阅文档 MonoBehaviour .

Subsections 章节

Unity3D脚本手册

标签:

原文地址:http://blog.csdn.net/u014581901/article/details/51335691

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!