Awake(唤醒):当一个脚本实例被载入时Awake被调用,要先于Start。建议少用,此刻物体可能还没有实例化出来,会影响程序执行顺序。
Start(开始):Start仅在Update函数第一次被调用前调用。物体实例化完成后调用(估计,没确认)。
FixedUpdate(固定频率刷新):这个函数会在每个固定的物理时间片被调用一次.这是放置游戏基本物理行为代码的地方。UPDATE之后调用。
Physics(物理)
Trigger(触发器)
Collision(碰撞器)
Rigibody(刚体的Transform位置和旋转的处理)
OnMouse(鼠标响应事件)
Update(刷新):当MonoBehaviour启用时,其Update在每一帧被调用
Animations Blend(动画混合)
LateUpdate(最后刷新)
Rendering(渲染)
using UnityEngine;
using System.Collections;
public class NewBehaviourScript : MonoBehaviour {
void Start () {
print ("Start");
}
void Update () {
print ("Update");
}
void FixedUpdate(){
print ("FixedUpdate");
}
void LateUpdate(){
print ("LateUpdate");
}
void OnGUI() {
if (GUI.Button(new Rect(10, 70, 50, 30), "Click"))
print("OnGUI");
}
}