标题: [重要的类]MonoBehaviour Mono行为 [打印本页] 作者: 驰骋的风 时间: 2012-10-11 10:53 标题: [重要的类]MonoBehaviour Mono行为 Inherits from Behaviour
MonoBehaviour is the base class every script derives from.
MonoBehaviour是每个脚本的基类.
Using Javascript every script automatically derives from MonoBehaviour. When using C# or Boo you have to explicitly derive from MonoBehaviour.
每个Javascript脚本自动继承MonoBehaviour,使用C#或Boo时,需要显式继承MonoBehaviour.
Note: The checkbox for disabling a MonoBehavior (on the editor) will only prevent Start(), Awake(), Update(), FixedUpdate(), and OnGUI() from***cuting. If none of these functions are present, the checkbox is not displayed.
注意:MonoBehavior对象(编辑器中)的复选框,只有在其有Start(),Awake(),Update(), FixedUpdate()和 OnGUI()函数时显示,没有这些函数时则隐藏。(另注:译者在PC上Windows平台测试结果与此注释所描述情况不符)
Variables变量
useGUILayout
Disabling this lets you skip the GUI layout phase.
禁用此项,将会跳过GUILayout布局阶段。
Functions函数
Invoke
Invokes the method methodName in time seconds.
在time秒调用methodName方法;简单说,根据时间调用指定方法名的方法
InvokeRepeating
Invokes the method methodName in time seconds.
在time秒调用methodName方法;简单说,每隔指定时间调用指定方法名的方法
CancelInvoke
Cancels all Invoke calls on this MonoBehaviour.
取消这个MonoBehaviour上的所有调用。
IsInvoking
Is any invoke on methodName pending?
某指定函数是否在等候调用。
StartCoroutine
Starts a coroutine.
开始协同程序。
StopCoroutine
Stops all coroutines named methodName***nning on this behaviour.
停止这个动作中名为methodName的所有协同程序
StopAllCoroutines
Stops all coroutines***nning on this behaviour.
停止所有动作的协同程序
Overridable Functions可重写函数
Update
Update is called every frame, if the MonoBehaviour is enabled.
当MonoBehaviour启用时,其Update在每一帧被调用。
LateUpdate
LateUpdate is called every frame, if the Behaviour is enabled.
当Behaviour启用时,其LateUpdate在每一帧被调用。
FixedUpdate
This function is called every fixed framerate frame, if the MonoBehaviour is enabled.
当MonoBehaviour启用时,其 FixedUpdate 在每一帧被调用。
Awake
Awake is called when the script instance is being loaded.
当一个脚本实例被载入时Awake被调用。
Start
Start is called just before any of the Update methods is called the first time.
Start仅在Update函数第一次被调用前调用。
Reset
Reset to default values.
重置为默认值。
OnMouseEnter
OnMouseEnter is called when the mouse entered the GUIElement or Collider.