RoleDataManager.cs 3.7 KB

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