快速連結

2015年11月12日

Unity MonoBehaviour內建函式執行順序

※2016.08:
LateUpdate()不見得會在Update()後出現、有時候也有可能在Awake()前出現。

Awake() → OnEnable() → Start() → Update() → LateUpdate() → OnGUI() → OnDestroy() → OnDisable()



不過OnGUI執行次數會是Update的兩倍,是因為他要取得執行Layout與重繪。
可以參考此篇的回答:Why is OnGUI called significantly more than Update and FixedUpdate?