RoleDataManager.cs 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. using System;
  2. using UnityEngine;
  3. using FairyGUI;
  4. using ET;
  5. using System.Collections.Generic;
  6. namespace GFGGame
  7. {
  8. public class RoleDataManager
  9. {
  10. public static bool powerTimeLock;
  11. public static long roleId;
  12. public static string roleName;
  13. public static int rechargeTotal;
  14. public static int rechargeTotalMon;
  15. public static int power
  16. {
  17. get
  18. {
  19. return GameGlobal.myNumericComponent.GetAsInt(NumericType.Power);
  20. }
  21. set
  22. {
  23. }
  24. }
  25. public static int gold
  26. {
  27. get
  28. {
  29. return GameGlobal.myNumericComponent.GetAsInt(NumericType.Gold);
  30. }
  31. set
  32. {
  33. }
  34. }
  35. private static int _exp = 0;
  36. public static int exp
  37. {
  38. get
  39. {
  40. return GameGlobal.myNumericComponent.GetAsInt(NumericType.Exp);
  41. }
  42. set
  43. {
  44. }
  45. }
  46. private static int _lvl = 1;
  47. public static int lvl
  48. {
  49. get
  50. {
  51. return GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl);
  52. }
  53. set
  54. {
  55. }
  56. }
  57. private static int _diaP = 0;
  58. public static int diaP
  59. {
  60. get
  61. {
  62. return GameGlobal.myNumericComponent.GetAsInt(NumericType.DiamondP);
  63. }
  64. set
  65. {
  66. }
  67. }
  68. private static int _diaR = 0;
  69. public static int diaR
  70. {
  71. get
  72. {
  73. return GameGlobal.myNumericComponent.GetAsInt(NumericType.DiamondR);
  74. }
  75. set
  76. {
  77. }
  78. }
  79. private static string _lastRandomName = null;
  80. public static string RandomRoleName()
  81. {
  82. string randomName = null;
  83. while (_lastRandomName == randomName || randomName == null)
  84. {
  85. int len = GameConst.ROLE_NAME_LIST.Length;
  86. System.Random random = new System.Random();
  87. int i = random.Next(len);
  88. randomName = GameConst.ROLE_NAME_LIST[i];
  89. }
  90. _lastRandomName = randomName;
  91. return randomName;
  92. }
  93. public static bool CheckPowerFull()
  94. {
  95. return GameGlobal.myNumericComponent.GetAsInt(NumericType.Power) >= GameConst.MAX_POWER_AUTO_REGAIN;
  96. }
  97. public static void InitServerData()
  98. {
  99. //roleId = roleInfo.id;
  100. roleName = GameGlobal.zoneScene.GetComponent<RoleInfosComponent>().GetCurrentRoleName();
  101. //rechargeTotal = roleInfo.rechargeTotal;
  102. //rechargeTotalMon = roleInfo.rechargeTotalMon;
  103. //_gold = roleInfo.gold;
  104. //_exp = roleInfo.exp;
  105. //_lvl = roleInfo.lvl;
  106. //_diaP = roleInfo.diaP;
  107. //_diaR = roleInfo.diaR;
  108. }
  109. }
  110. }