GameGlobal.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. using UnityEngine;
  2. using ET;
  3. using LitJson;
  4. namespace GFGGame
  5. {
  6. public class GameGlobal
  7. {
  8. public static bool isVisitor = false;
  9. public static bool isFirstEntry = false;
  10. public static string cfgName;
  11. //防沉迷开关
  12. public static bool antiAddiction = true;
  13. public static long userId = 0;
  14. public static int userAge = 0;
  15. public static bool skipGuide;
  16. public static bool skipCheckOpen;//跳过功能开启检查
  17. public static bool isEnterGame = false;
  18. public static string loginApiUrl;
  19. //ET
  20. public static Scene zoneScene;
  21. public static Unit myUnit;
  22. public static NumericComponent myNumericComponent;
  23. public static int lastLoginTime;//上次登录时间
  24. //平台
  25. public static int platformId = 1;
  26. public static void Init()
  27. {
  28. cfgName = LauncherConfig.cfgName + "_in";
  29. }
  30. public static string version
  31. {
  32. get
  33. {
  34. return Application.version + "." + VEngine.Versions.ManifestsVersion;
  35. }
  36. }
  37. public static void InitData(string json)
  38. {
  39. var result = JsonMapper.ToObject<Result>(json);
  40. loginApiUrl = result.loginApiUrl;
  41. ConstValue.LoginAddress = loginApiUrl;
  42. }
  43. private struct Result
  44. {
  45. public string loginApiUrl;
  46. }
  47. }
  48. }