GlobalParam.cs 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. using System;
  2. using Fort23.UTool;
  3. namespace Core.Utility
  4. {
  5. public class GlobalParam
  6. {
  7. public static int Item_Coin_ID = 1001;
  8. public static int Item_Diamond_ID = 1002;
  9. public static int Item_HeroExp_ID = 1003;
  10. /// <summary>
  11. /// 英雄最大上阵数量
  12. /// </summary>
  13. public static int Max_Deploy_HERO = 4;
  14. /// <summary>
  15. /// 主界面英雄头像,点击后,向上偏移的位移
  16. /// </summary>
  17. public static int Hero_Pos_Offset = 110;
  18. /// <summary>
  19. /// 最大等级差
  20. /// </summary>
  21. public static int Max_Main_Level_Difference = 10;
  22. /// <summary>
  23. /// 普攻技能组
  24. /// </summary>
  25. public static int Normal_Attack_Skill_Group_ID = 1001;
  26. /// <summary>
  27. /// 升级时,背景高度
  28. /// </summary>
  29. public static int Hero_Upgrade_UI_BG_Height = 283;
  30. /// <summary>
  31. /// 仅升星时,背景高度
  32. /// </summary>
  33. public static int Hero_Promote_UI_BG_Only_Star_Height = 283;
  34. /// <summary>
  35. /// 升星、解锁技能时,背景高度
  36. /// </summary>
  37. public static int Hero_Promote_UI_BG_Unlock_Skill_Height = 420;
  38. /// <summary>
  39. /// 仅升星时,星星y的位置
  40. /// </summary>
  41. public static int Hero_Promote_UI_BG_Star_Pos_1 = 0;
  42. /// <summary>
  43. /// 升星、解锁技能时,星星y的位置
  44. /// </summary>
  45. public static int Hero_Promote_UI_BG_Star_Pos_2 = 150;
  46. public static int GenerateEquipmentID(int zy, int eqType, int eqLv, int mainLv)
  47. {
  48. if (mainLv <= 10)
  49. {
  50. eqLv = 10;
  51. }
  52. else
  53. {
  54. int tmp = 5 - mainLv % 5;
  55. tmp = mainLv + tmp;
  56. eqLv += tmp;
  57. }
  58. // Debug.Log("eqLevel=" + eqLv);
  59. int equipmentConfigID = zy * 10000 + eqType * 1000 + eqLv;
  60. return equipmentConfigID;
  61. }
  62. /// <summary>
  63. /// 生成一个基于毫秒级时间戳的 GUID
  64. /// </summary>
  65. /// <returns>返回一个字符串形式的 GUID</returns>
  66. public static string GenerateGUID()
  67. {
  68. // 获取当前的毫秒级时间戳
  69. long timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
  70. // 生成一个随机数(确保 GUID 的部分随机性)
  71. int randomPart = UnityEngine.Random.Range(1000, 9999);
  72. LogTool.Log(timestamp);
  73. LogTool.Log(randomPart);
  74. // 拼接时间戳和随机数
  75. return $"{timestamp}{randomPart}";
  76. }
  77. }
  78. }