Description描述
The scale at which the time is passing. This can be used for slow motion effects.
傳遞時(shí)間的縮放。這可以用于減慢運(yùn)動(dòng)效果。
When timeScale is 1.0 the time is passing as fast as realtime. When timeScale is 0.5 the time is passing 2x slower than realtime.
當(dāng)timeScale傳遞時(shí)間1.0時(shí)和實(shí)時(shí)時(shí)間一樣快。當(dāng)timeScale傳遞時(shí)間0.5時(shí)比實(shí)時(shí)時(shí)間慢一半。
When timeScale is set to zero the game is basically paused if all your functions are frame rate independent.
當(dāng)timeScale傳遞時(shí)間為0時(shí)游戲基本上暫停了,如果你的所有函數(shù)是和幀速率無(wú)關(guān)的。
Except for realtimeSinceStartup, timeScale affects all the time and delta time measuring variables of the Time class.
除了realtimeSinceStartup,timeScale影響所有時(shí)間和增量時(shí)間基于Time類(lèi)的變量。
If you lower timeScale it is recommended to also lower Time.fixedDeltaTime by the same amount.
如果降低timeScale,建議也降低Time.fixedDeltaTime同樣的數(shù)值。
FixedUpdate functions will not be called when timeScale is set to zero.
當(dāng)timescale設(shè)置為0時(shí),F(xiàn)ixedUpdate函數(shù)將不會(huì)被調(diào)用。
// Toggles the time scale between 1 and 0.7
// whenever the user hits the Fire1 button.
//切換時(shí)間縮放在1-0.7之間,每當(dāng)用戶點(diǎn)擊Fire1按鈕。function Update () {
if (Input.GetButtonDown ("Fire1")) {
if (Time.timeScale == 1.0)
Time.timeScale= 0.7;
else
Time.timeScale= 1.0;
// Adjust fixed delta time according to timescale // The fixed delta time will now be 0.02 frames per real-time second //根據(jù)timescale調(diào)整固定增量時(shí)間。 Time.fixedDeltaTime = 0.02 * Time.timeScale;
}
}
分享名稱:Time.timeScale時(shí)間縮放-創(chuàng)新互聯(lián)
網(wǎng)頁(yè)地址:http://m.kartarina.com/article30/cddjso.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供建站公司、電子商務(wù)、微信公眾號(hào)、微信小程序、網(wǎng)站改版、網(wǎng)站收錄
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容