Unity Update事件的顺序。

http://docs.unity3d.com/Documentation/Manual/ExecutionOrder.html


例如

  • FixedUpdate: FixedUpdate() is often called more frequently than Update(). It can be called multiple times per frame, if the frame rate is low and it may not be called between frames at all if the frame rate is high. All physics calculations and updates occur immediately after FixedUpdate(). When applying movement calculations insideFixedUpdate(), you do not need to multiply your values by Time.deltaTime. This is because FixedUpdate() is called on a reliable timer, independent of the frame rate.
  • Update: Update() is called once per frame. It is the main workhorse function for frame updates.
  • LateUpdate: LateUpdate() is called once per frame, after Update() has finished. Any calculations that are performed in Update() will have completed when LateUpdate()begins. A common use for LateUpdate() would be a following third-person camera. If you make your character move and turn inside Update(), you can perform all camera movement and rotation calculations in LateUpdate(). This will ensure that the character has moved completely before the camera tracks its position.

FixedUpdate() 是按等长事件间隔来调用的,不一定和帧等价,可能一帧多次,也可能几帧一次。  一般用在物理引擎上(因为物理引擎对回调间隔精度要求比较严)。

Update: Update()     每帧一次,修改状态在这个弄。

LateUpdate: LateUpdate()   在LateUpdate里面,也就是说,修改完状态了,一般用来做视角跟踪的。






  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值