Unity 常用脚本:Time

Time类

 从Unity中获取时间信息的接口。

 public static float realtimeSinceStartup { get; }

摘要:The real time in seconds since the game started (Read Only). 

游戏开始后以秒为单位的实时时间(只读)。即游戏运行时间。

public static int frameCount { get; }

摘要:The total number of frames that have passed (Read Only).已通过的帧的总数(只读)

public static float timeScale { get; set; }

摘要:The scale at which the time is passing. This can be used for slow motion effects.

时间流逝的尺度。这可以用于慢动作效果。

 public static float maximumParticleDeltaTime { get; set; }

摘要:The maximum time a frame can spend on particle updates. If the frame takes longer than this, then updates are split into multiple smaller updates.

一帧用于粒子更新的最长时间。如果帧花费的时间比这个长,那么更新就会被分成多个较小的更新。

public static float smoothDeltaTime { get; }

摘要: A smoothed out Time.deltaTime (Read Only).平滑的时间间隔(只读)。

public static float maximumDeltaTime { get; set; }

摘要:The maximum time a frame can take. Physics and other fixed frame rate updates (like MonoBehaviour's MonoBehaviour.FixedUpdate) will be performed only for this duration of time per frame. 

一帧所能花费的最大时间。物理和其他固定帧速率更新(如MonoBehaviour的MonoBehaviour. fixedupdate)只在每帧的这段时间内执行。

public static int captureFramerate { get; set; }

摘要: Slows game playback time to allow screenshots to be saved between frames.

放慢游戏回放时间,以便在帧与帧之间保存截图。

public static float fixedDeltaTime { get; set; }

摘要: The interval in seconds at which physics and other fixed frame rate updates (like MonoBehaviour's MonoBehaviour.FixedUpdate) are performed.

物理和其他固定帧速率更新(如MonoBehaviour的MonoBehaviour. fixedupdate)执行的时间间隔(以秒为单位)。

public static float unscaledDeltaTime { get; }

摘要:The timeScale-independent interval in seconds from the last frame to the current one (Read Only). 

从最后一帧到当前帧(只读)的时间间隔(以秒为单位)。

public static float fixedUnscaledTime { get; }

摘要: The TimeScale-independant time the latest MonoBehaviour.FixedUpdate has started (Read Only). This is the time in seconds since the start of the game.

与时间尺度无关的时间是最新的单行为。FixedUpdate已经启动(只读)。这是游戏开始后以秒为单位的时间。

public static float unscaledTime { get; }

摘要: The timeScale-independant time for this frame (Read Only). This is the time in seconds since the start of the game.

此帧的时间尺度无关的时间(只读)。这是游戏开始后以秒为单位的时间。

public static float fixedTime { get; }

 摘要:The time the latest MonoBehaviour.FixedUpdate has started (Read Only). This is the time in seconds since the start of the game.

时间最新的单行为。FixedUpdate已经启动(只读)。这是游戏开始后以秒为单位的时间。

public static float deltaTime { get; }

摘要: The completion time in seconds since the last frame (Read Only).从最后一帧开始的完成时间(只读),以秒为单位。

public static float timeSinceLevelLoad { get; } 

摘要:The time this frame has started (Read Only). This is the time in seconds since the last level has been loaded.

此帧已开始的时间(只读)。这是以秒为单位的时间,从最后一个级别已经加载。

public static float time { get; }

摘要: The time at the beginning of this frame (Read Only). This is the time in seconds since the start of the game.

此帧开始的时间(只读)。这是游戏开始后以秒为单位的时间。

public static float fixedUnscaledDeltaTime { get; }

摘要: The timeScale-independent interval in seconds from the last fixed frame to the current one (Read Only). 

从最后一个固定帧到当前帧(只读)的时间间隔(以秒为单位)。

public static bool inFixedTimeStep { get; }

摘要:Returns true if called inside a fixed time step callback (like MonoBehaviour's MonoBehaviour.FixedUpdate), otherwise returns false.

如果在固定时间步回调函数中调用(如MonoBehaviour的monobehavior . fixedupdate),则返回true,否则返回false。

 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值