[Unity]什么是FixedUpdate()?什么是LateUpdate()?
Copyright Notice: This article is an original work licensed under the CC 4.0 BY-NC-ND license.
If you wish to repost this article, please include the original source link and this copyright notice.
Source link: https://v2know.com/article/248
什么是FixedUpdate()?
这是用于处理Rigbody的专用方法,
因为Update()是按帧执行,FixedUpdate()是真实时间执行,
FixedUpdate()可设置时间间隔。
PS:Edit->ProjectSetting->time 找到Fixedtimestep,就可以修改时间间隔了。
物体移动一般有两种方法,一种是在Update里面更新Transform的Positon,但是别忘记加delataTime,
另外一种是物理加速度,在FixedUpdate方法里面更新(不过我倒是没试过)。
什么是LateUpdate()?
LateUpdate是在所有Update函数调用后被调用。
参考文档:
[1] Unity3d Update和FixedUpdate、LateUpdate的区别
This article was last edited at 2020-04-11 07:50:17