您的位置:首页 > 移动开发 > Unity3D

Unity5.x 之 Time详解

2016-12-20 21:22 387 查看


Time

class in UnityEngine


Description

Unity当中获取 时间信息的接口


Static Variables

captureFramerateSlows game playback time to allow screenshots to be saved between frames.
deltaTimeThe time in seconds it took to complete the last frame (Read Only).

上一帧完成所用的时间秒(只读)
fixedDeltaTimeThe interval in seconds at which physics and other fixed frame rate updates (like MonoBehaviour's FixedUpdate) are performed.

在物理和固定帧更新的时间间隔秒(类似MonoBehavior's FixedUpdate)
fixedTimeThe time the latest FixedUpdate has started (Read Only). This is the time in seconds since the start of the game.

最近的一次FixedUpdate已开始的时间(只读)自游戏开始计时,以秒记。
frameCountThe total number of frames that have passed (Read Only).

已经执行的帧率的总数。
maximumDeltaTimeThe maximum time a frame can take. Physics and other fixed frame rate updates (like MonoBehaviour's FixedUpdate).

在物理帧和其他帧更新中,一帧能获取的最大时间。
realtimeSinceStartupThe real time in seconds since the game started (Read Only).

从游戏开始到现在所消耗的实时时间(只读)。
smoothDeltaTimeA smoothed out Time.deltaTime (Read Only).

一个平滑淡出的Time.deltaTime(只读)
timeThe time at the beginning of this frame (Read Only). This is the time in seconds since the start of the game.
从游戏开始到现在所消耗的时间(只读)。
timeScaleThe scale at which the time is passing. This can be used for slow motion effects.

时间的消耗速率,可以减慢运动效果。
timeSinceLevelLoadThe time this frame has started (Read Only). This is the time in seconds since the last level has been loaded.

从上次加载管卡完成到现在所用的时间(只读)
unscaledDeltaTimeThe timeScale-independent time in seconds it took to complete the last frame (Read Only).

不受timeScale系数影响的deltaTime。
unscaledTimeThe timeScale-independant time at the beginning of this frame (Read Only). This is the time in seconds since the start of the game.

不受timeScale系数影响的Time.time。
补充:

1.timeScale影响的是Time.deltaTime的值,但不影响Time.FixedDeltaTime.

2.timeScale影响FixedUpdate 的执行速率,但不影响Update和LateUpdate.

3.timeScale影响Time.time的值和Time.FixedTime的值。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息