RoleDataManager.cs 3.4 KB

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