Description描述
This function is called every fixed framerate frame, if the MonoBehaviour is enabled.
當(dāng)MonoBehaviour啟用時,其 FixedUpdate 在每一幀被調(diào)用。
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。例如:給剛體加一個作用力時,你必須應(yīng)用作用力在FixedUpdate里的固定幀,而不是Update中的幀。(兩者幀長不同)
// Apply a upwards force to the rigid body every frame
// 每幀應(yīng)用一個向上的力到剛體上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.
為了獲取自最后一次調(diào)用FixedUpdate所用的時間,可以用Time.deltaTime。這個函數(shù)只有在Behaviour啟用時被調(diào)用。實現(xiàn)組件功能時重載這個函數(shù)。
分享題目:MonoBehaviour.FixedUpdate固定更新-創(chuàng)新互聯(lián)
分享地址:http://vcdvsql.cn/article26/ceopcg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供關(guān)鍵詞優(yōu)化、網(wǎng)站設(shè)計、網(wǎng)站營銷、品牌網(wǎng)站制作、網(wǎng)站設(shè)計公司、自適應(yīng)網(wǎng)站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容