Unity3D中Update和Lateupdate的区别

如题所述

第1个回答  推荐于2017-09-29
这个可以参考Unity3d官方文档:
Update:
Update is called every frame, if the MonoBehaviour is enabled.
Update is the most commonly used function to implement any kind of game behaviour.
也就是说,Update是每一帧都会调用一次的
LateUpdate is called every frame, if the Behaviour is enabled.
LateUpdate is called after all Update functions have been called. This is useful to order script execution. For example a follow camera should always be implemented in LateUpdate because it tracks objects that might have moved inside Update.
也就是LateUpdate在Update后调用,官方推荐像摄像机跟随的功能放在LateUpdate里,因为它所追踪的对象可能在Update中进行了移动。
总之,LateUpdate在Update之后运行,即等所有Update执行完毕后,执行LateUpdate本回答被提问者和网友采纳
第2个回答  2015-06-06
就是执行顺序不一样。
相似回答