ResPathUtil.cs 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. namespace GFGGame
  2. {
  3. public class ResPathUtil
  4. {
  5. public const string RESIN_TXT_DIR_PATH = "Assets/ResIn/Txt";
  6. public const string FONT_DIR_PATH = "Assets/Res/Font";
  7. public const string MUSIC_DIR_PATH = "Assets/Res/Music";
  8. public const string SOUND_DIR_PATH = "Assets/Res/Sound";
  9. public const string UI_DIR_PATH = "Assets/ResIn/UI";
  10. public const string TEXTURE_DIR_PATH = "Assets/Res/Texture";
  11. public const string PREFAB_DIR_PATH = "Assets/Res/Prefab";
  12. public const string CONFIG_DIR_PATH = "Assets/Res/Config";
  13. public const string ANIMATION_DIR_PATH = "Assets/Res/Animation";
  14. public const string EFFECT_DIR_PATH = "Assets/Res/Effect";
  15. public const string SQLITE_FILE_PATH = CONFIG_DIR_PATH + "/" + LauncherConfig.SQL_FILE_NAME;
  16. public static string GetUIPackagePath(string res)
  17. {
  18. return $"{UI_DIR_PATH}/{res}/{res}";
  19. }
  20. public static string GetCommonGameResPath(string res)
  21. {
  22. return "ui://CommonGame/" + res;
  23. }
  24. //===================================¡ü¡ü¡üUI·¾¶¡ü¡ü¡ü================================
  25. public static string GetIconPath(string res, string extName)
  26. {
  27. return $"{TEXTURE_DIR_PATH}/Icon/{res}.{extName}";
  28. }
  29. public static string GetIconPath(ItemCfg itemCfg)
  30. {
  31. return GetIconPath(itemCfg.res, ItemUtil.GetItemResExt(itemCfg.itemType, itemCfg.subType));
  32. }
  33. public static string GetDressUpPath(string res, string extName = "png")
  34. {
  35. return $"{TEXTURE_DIR_PATH}/DressUp/{res}.{extName}";
  36. }
  37. public static string GetNpcPicSPath(string res, string extName = "png")
  38. {
  39. return $"{TEXTURE_DIR_PATH}/Npc/PicS/{res}.{extName}";
  40. }
  41. public static string GetNpcPicFPath(string res, string extName = "png")
  42. {
  43. return $"{TEXTURE_DIR_PATH}/Npc/PicF/{res}.{extName}";
  44. }
  45. public static string GetPhotographFPath(string res, string extName = "png")
  46. {
  47. return $"{TEXTURE_DIR_PATH}/Photograph/{res}.{extName}";
  48. }
  49. public static string GetFieldGuideIconPath(string res, string extName = "png")
  50. {
  51. return $"{TEXTURE_DIR_PATH}/FieldGuide/Icon/{res}.{extName}";
  52. }
  53. public static string GetNpcHeadPath(string res, string extName = "png")
  54. {
  55. return $"{TEXTURE_DIR_PATH}/Npc/Head/{res}.{extName}";
  56. }
  57. public static string GetCardPath(string res, string extName = "jpg")
  58. {
  59. return $"{TEXTURE_DIR_PATH}/Card/Bg/{res}.{extName}";
  60. }
  61. public static string GetCardSmallPath(string res, string extName = "jpg")
  62. {
  63. return $"{TEXTURE_DIR_PATH}/Card/Card/{res}.{extName}";
  64. }
  65. public static string GetCardSoundPath(string res, string extName = "mp3")
  66. {
  67. return $"{SOUND_DIR_PATH}/Card/{res}.{extName}";
  68. }
  69. public static string GetMusicPath(string res, string extName = "mp3")
  70. {
  71. return $"{MUSIC_DIR_PATH}/{res}.{extName}";
  72. }
  73. public static string GetTxtPath(string res, string extName = "txt")
  74. {
  75. return $"{RESIN_TXT_DIR_PATH}/{res}.{extName}";
  76. }
  77. public static string GetFontPath(string res, string extName = "TTF")
  78. {
  79. return $"{FONT_DIR_PATH}/{res}.{extName}";
  80. }
  81. public static string GetPrefabPath(string res, string extName = "prefab")
  82. {
  83. return $"{PREFAB_DIR_PATH}/{res}.{extName}";
  84. }
  85. public static string GetDressUpAnimationPath(string res, string extName = "prefab")
  86. {
  87. return $"{ANIMATION_DIR_PATH}/DressUp/{res}/{res}.{extName}";
  88. }
  89. public static string GetDressUpEffectPath(string res, string extName = "prefab")
  90. {
  91. return $"{EFFECT_DIR_PATH}/{res}/{res}.{extName}";
  92. }
  93. public static string GetCardAnimationPath(string res, string extName = "prefab")
  94. {
  95. return $"{ANIMATION_DIR_PATH}/Card/{res}/{res}.{extName}";
  96. }
  97. }
  98. }