TimeHelper.cs 966 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. namespace KYFramework
  2. {
  3. public static class TimeHelper
  4. {
  5. public const long OneDay = 86400000;
  6. public const long Hour = 3600000;
  7. public const long Minute = 60000;
  8. /// <summary>
  9. /// 客户端时间
  10. /// </summary>
  11. /// <returns></returns>
  12. public static long ClientNow()
  13. {
  14. return Game.Scene.GetComponent<Timer>().ClientNow();
  15. }
  16. public static DateTime DateTimeNow()
  17. {
  18. return DateTime.Now;
  19. }
  20. public static long ServerNow()
  21. {
  22. return Game.Scene.GetComponent<Timer>().ServerNow();
  23. }
  24. public static long ServerFrameTime()
  25. {
  26. return Game.Scene.GetComponent<Timer>().ServerFrameTime();
  27. }
  28. public static long ClientFrameTime()
  29. {
  30. return Game.Scene.GetComponent<Timer>().ClientFrameTime();
  31. }
  32. }
  33. }