MonoBehaviour.FixedUpdate固定更新-创新互联

function FixedUpdate () : voidMonoBehaviour.Fi
xedUpdate固定更新

Description描述

成都创新互联长期为上千余家客户提供的网站建设服务,团队从业经验10年,关注不同地域、不同群体,并针对不同对象提供差异化的产品和服务;打造开放共赢平台,与合作伙伴共同营造健康的互联网生态环境。为吴川企业提供专业的成都网站建设、做网站,吴川网站改版等技术服务。拥有10余年丰富建站经验和众多成功案例,为您定制开发。

This function is called every fixed framerate frame, if the MonoBehaviour is enabled.

当MonoBehaviour启用时,其 FixedUpdate 在每一帧被调用。

FixedUpdate should be used instead of Update when dealing with Rigidbody . For example when adding a force to a rigidbody, you have to apply the force every fixed frame inside FixedUpdate instead of every frame inside Update.

处理Rigidbody时,需要用FixedUpdate代替Update。例如:给刚体加一个作用力时,你必须应用作用力在FixedUpdate里的固定帧,而不是Update中的帧。(两者帧长不同)

// Apply a upwards force to the rigid body every frame
// 每帧应用一个向上的力到刚体上function FixedUpdate () {
    rigidbody.AddForce ( Vector3.up );
}

In order to get the elapsed time since last call to FixedUpdate, use Time.deltaTime This function is only called if the Behaviour is enabled. Override this function in order to provide your component's functionality.

为了获取自最后一次调用FixedUpdate所用的时间,可以用Time.deltaTime。这个函数只有在Behaviour启用时被调用。实现组件功能时重载这个函数。

分享题目:MonoBehaviour.FixedUpdate固定更新-创新互联
分享地址:https://www.cdcxhl.com/article26/ceopcg.html

成都网站建设公司_创新互联,为您提供关键词优化网站设计网站营销品牌网站制作网站设计公司自适应网站

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联

成都网站建设公司