GlobalParam.cs 2.8 KB

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