12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- using System;
- using UnityEngine;
- public class NTime
- {
- public static float time
- {
- get
- {
- return NTime.m_fNow;
- }
- }
- public static float realtimeSinceStartup
- {
- get
- {
- return NTime.m_fNow;
- }
- }
- public static float deltaTime
- {
- get
- {
- return NTime.m_fDelta;
- }
- }
- public static void Reset()
- {
- NTime.m_fDelay = (NTime.m_fNow = (NTime.m_fBack = (NTime.m_fDelta = 0f)));
- }
- public static void SetDelay(float f_nDelay)
- {
- NTime.m_fDelay = f_nDelay;
- }
- public static void UpdateNowTime(float f_nNow)
- {
- NTime.m_fNow = f_nNow;
- NTime.m_fDelta = NTime.m_fNow - NTime.m_fBack;
- if (NTime.m_fDelta < 0f)
- {
- Debug.LogError("時間がマイナスです。");
- }
- NTime.m_fBack = NTime.m_fNow;
- }
- private static float m_fDelay;
- private static float m_fNow;
- private static float m_fBack;
- private static float m_fDelta;
- }
|