Unity生命周期及函数执行顺序详解

Unity生命周期及函数执行顺序详解

补充:

Awake():Awake is called when the script instance is being loaded.
Start():Start is called on the frame when a script is enabled just before any of the Update methods is called the first time.

从官方文档中可以看出二者的区别是: Awake()是在脚本对象实例化时被调用的,而Start()是在对象的第一帧时被调用的,而且是在Update()之前。

转自简书博客。如有侵权,请联系删除。
如果觉得写的还不错那就回来给我点个赞吧

猜你喜欢

转载自blog.csdn.net/X_King_Q/article/details/107643479