RoleDataManager.cs 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. using FairyGUI;
  2. using ET;
  3. using System.Collections.Generic;
  4. namespace GFGGame
  5. {
  6. public class RoleDataManager
  7. {
  8. public static bool powerTimeServerLock;
  9. public static long roleId;
  10. public static string roleName;
  11. public static int rechargeTotalMon
  12. {
  13. get
  14. {
  15. return GameGlobal.myNumericComponent.GetAsInt(NumericType.RechargeTotaMonthly);
  16. }
  17. }
  18. public static string slogan = "";
  19. public static int headId
  20. {
  21. get
  22. {
  23. return 5000001;
  24. }
  25. }
  26. public static int headBorderId
  27. {
  28. get
  29. {
  30. return 5005001;
  31. }
  32. }
  33. public static int power
  34. {
  35. get
  36. {
  37. return GameGlobal.myNumericComponent.GetAsInt(NumericType.Power);
  38. }
  39. }
  40. public static int gold
  41. {
  42. get
  43. {
  44. return ItemDataManager.GetItemNum(ConstItemID.GOLD); //GameGlobal.myNumericComponent.GetAsInt(NumericType.Gold);
  45. }
  46. }
  47. public static int exp
  48. {
  49. get
  50. {
  51. return GameGlobal.myNumericComponent.GetAsInt(NumericType.Exp);
  52. }
  53. }
  54. public static int lvl
  55. {
  56. get
  57. {
  58. return GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl);
  59. }
  60. }
  61. public static int diaP
  62. {
  63. get
  64. {
  65. return ItemDataManager.GetItemNum(ConstItemID.DIAMOND_PURPLE); // GameGlobal.myNumericComponent.GetAsInt(NumericType.DiamondP);
  66. }
  67. }
  68. public static int diaR
  69. {
  70. get
  71. {
  72. return ItemDataManager.GetItemNum(ConstItemID.DIAMOND_RED); //GameGlobal.myNumericComponent.GetAsInt(NumericType.DiamondR);
  73. }
  74. }
  75. public static int Liveness
  76. {
  77. get
  78. {
  79. return GameGlobal.myNumericComponent.GetAsInt(NumericType.Liveness);
  80. }
  81. }
  82. public static bool CheckPowerFull()
  83. {
  84. return RoleDataManager.power >= GameGlobal.myNumericComponent.GetAsInt(NumericType.PowerLimit);
  85. }
  86. public static void InitServerData()
  87. {
  88. roleName = GameGlobal.zoneScene.GetComponent<RoleInfosComponent>().GetCurrentRoleName();
  89. roleId = GameGlobal.zoneScene.GetComponent<RoleInfosComponent>().CurrentRoleId;
  90. }
  91. private static int oldLvValue;
  92. public static void RoleLvUp(int oldValue)
  93. {
  94. oldLvValue = oldValue;
  95. Timers.inst.Remove(CheckUpLv);
  96. Timers.inst.Remove(OpenRoleLvUpView);
  97. Timers.inst.Add(0.2f, 0, CheckUpLv);
  98. CheckUpLv(null);
  99. }
  100. private static void CheckUpLv(object param)
  101. {
  102. if (GuideDataManager.currentGuideId > 0) return;
  103. if (ViewManager.isViewOpen(typeof(FunctionOpenView).Name)) return;//等功能开启展示完成后再展示角色升级
  104. if (ViewManager.isViewOpen(typeof(StoryFightSingleScoreView).Name)) return;//战斗界面关闭前不弹升级
  105. if (ViewManager.isViewOpen(typeof(StoryFightTargetScoreView).Name)) return;//战斗界面关闭前不弹升级
  106. if (InstanceZonesDataManager.isQuicklyFighting == true) return;//速刷中不弹
  107. if (InstanceZonesDataManager.isResultFighting == true) return;//结算中经验进度结束前不弹
  108. OpenRoleLvUpView(null);
  109. }
  110. private static void OpenRoleLvUpView(object param)
  111. {
  112. ViewManager.Show<RoleLvUpView>(oldLvValue);
  113. Timers.inst.Remove(CheckUpLv);
  114. }
  115. }
  116. }