From cbf145c5cd2e037912bebe79debf4514d3d9d610 Mon Sep 17 00:00:00 2001 From: ALEXTANG <574809918@qq.com> Date: Mon, 3 Apr 2023 15:46:27 +0800 Subject: [PATCH] Update GameTime.cs --- .../TEngine/Runtime/GameFramework/GameTime.cs | 28 ++++++++++++++----- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/Assets/TEngine/Runtime/GameFramework/GameTime.cs b/Assets/TEngine/Runtime/GameFramework/GameTime.cs index 25320316..3999168e 100644 --- a/Assets/TEngine/Runtime/GameFramework/GameTime.cs +++ b/Assets/TEngine/Runtime/GameFramework/GameTime.cs @@ -1,19 +1,33 @@ -namespace TEngine +using UnityEngine; + +namespace TEngine { - public class GameTime + /// + /// 游戏时间。 + /// 统一封装调用。 + /// + public static class GameTime { public static float time; public static float deltaTime; + public static float unscaledDeltaTime; + public static float fixedDeltaTime; + public static float frameCount; + public static float unscaledTime; - public static float unscaledDeltaTime; - - public static float fixedUnscaledDeltaTime; - - public static float realtimeSinceStartup; + public static void StartFrame() + { + time = Time.time; + deltaTime = Time.deltaTime; + unscaledDeltaTime = Time.unscaledDeltaTime; + fixedDeltaTime = Time.fixedDeltaTime; + frameCount = Time.frameCount; + unscaledTime = Time.unscaledTime; + } } } \ No newline at end of file