RoleDataManager.cs 3.6 KB

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