Description描述
The scale at which the time is passing. This can be used for slow motion effects.
傳遞時間的縮放。這可以用于減慢運(yùn)動效果。
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傳遞時間1.0時和實(shí)時時間一樣快。當(dāng)timeScale傳遞時間0.5時比實(shí)時時間慢一半。
When timeScale is set to zero the game is basically paused if all your functions are frame rate independent.
當(dāng)timeScale傳遞時間為0時游戲基本上暫停了,如果你的所有函數(shù)是和幀速率無關(guān)的。
Except for realtimeSinceStartup, timeScale affects all the time and delta time measuring variables of the Time class.
除了realtimeSinceStartup,timeScale影響所有時間和增量時間基于Time類的變量。
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時,F(xiàn)ixedUpdate函數(shù)將不會被調(diào)用。
// Toggles the time scale between 1 and 0.7
// whenever the user hits the Fire1 button.
//切換時間縮放在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)整固定增量時間。 Time.fixedDeltaTime = 0.02 * Time.timeScale;
}
}