123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196 |
- namespace GFGGame
- {
- public class ResPathUtil
- {
- public const string FONT_DIR_PATH = "Assets/ResIn/Font";
- public static readonly string UI_DIR_PATH = "Assets/ResIn/UI";
- public static readonly string PREFAB_DIR_PATH = "Assets/ResIn/Prefab";
- public static readonly string TEXTURE_FIGHT_DIR_PATH = "Assets/ResIn/Fight";
- public static readonly string CONFIG_DIR_PATH = "Assets/Game/CSShare/Sqlite";
- public const string RES_ROOT_DIR_PATH = "Assets/Res";
- public static readonly string MUSIC_DIR_PATH = $"{RES_ROOT_DIR_PATH}/Music";
- public static readonly string SOUND_DIR_PATH = $"{RES_ROOT_DIR_PATH}/Sound";
- public static readonly string TEXTURE_DIR_PATH = $"{RES_ROOT_DIR_PATH}/Texture";
- public static readonly string ANIMATION_DIR_PATH = $"{RES_ROOT_DIR_PATH}/Animation";
- public static readonly string EFFECT_DIR_PATH = $"{RES_ROOT_DIR_PATH}/Effect";
- public static readonly string Material_DIR_PATH = $"{RES_ROOT_DIR_PATH}/Material";
- public static readonly string Shader_DIR_PATH = $"{RES_ROOT_DIR_PATH}/Shader";
- public static readonly string Model_DIR_PATH = $"{RES_ROOT_DIR_PATH}/model";
- public static readonly string SQLITE_FILE_PATH = CONFIG_DIR_PATH + "/" + LauncherConfig.SQL_FILE_NAME;
- public static string GetUIPackagePath(string res)
- {
- return $"{UI_DIR_PATH}/{res}/{res}";
- }
- public static string GetScorePath(int score)
- {
- return GetCommonGameResPath("kp_sx_" + score);
- }
- public static string GetCommonGameResPath(string res)
- {
- return "ui://CommonGame/" + res;
- }
- //===================================↑↑↑UI路径↑↑↑================================
- public static string GetIconPath(string res, string extName)
- {
- if (res.IndexOf("kp_") == 0)
- {
- return GetCardIconPath(res);
- }
- return $"{TEXTURE_DIR_PATH}/Icon/{res}.{extName}";
- }
- public static string GetIconPath(ItemCfg itemCfg)
- {
- return GetIconPath(itemCfg.res, ItemUtil.GetItemResExt(itemCfg.itemType, itemCfg.subType, true));
- }
- public static string GetBgImgPath(string res, string extName = "png")
- {
- return $"{TEXTURE_DIR_PATH}/BgImg/{res}.{extName}";
- }
- public static string GetFightBgImgPath(string res, string extName = "png")
- {
- return $"{TEXTURE_FIGHT_DIR_PATH}/{res}.{extName}";
- }
- public static string GetDressUpPath(string res, string extName = "png")
- {
- return $"{TEXTURE_DIR_PATH}/DressUp/{res}.{extName}";
- }
- public static string GetNpcPicSPath(string res, string extName = "png")
- {
- return $"{TEXTURE_DIR_PATH}/Npc/PicS/{res}.{extName}";
- }
- public static string GetNpcPicFPath(string res, string extName = "png")
- {
- return $"{TEXTURE_DIR_PATH}/Npc/PicF/{res}.{extName}";
- }
- public static string GetPhotographBorderPath(string res, string extName = "png")
- {
- return $"{TEXTURE_DIR_PATH}/Photograph/border/{res}.{extName}";
- }
- public static string GetFieldGuideIconPath(string res, string extName = "png")
- {
- return $"{TEXTURE_DIR_PATH}/FieldGuide/SuitIcon/{res}.{extName}";
- }
- public static string GetChapterGuideIconPath(string res, string extName = "png")
- {
- return $"{TEXTURE_DIR_PATH}/FieldGuide/ChapterIcon/{res}.{extName}";
- }
- public static string GetNpcHeadPath(string res, string extName = "png")
- {
- return $"{TEXTURE_DIR_PATH}/Npc/Head/{res}.{extName}";
- }
- public static string GetCardPath(string res, string extName = "jpg")
- {
- return $"{TEXTURE_DIR_PATH}/Card/Bg/{res}.{extName}";
- }
- public static string GetCardIconPath(string res, string extName = "jpg")
- {
- return $"{TEXTURE_DIR_PATH}/Card/Card/{res}.{extName}";
- }
- public static string GetCardSkillPath(string res, string extName = "png")
- {
- return $"{TEXTURE_DIR_PATH}/Card/Skill/{res}.{extName}";
- }
- public static string GetCardSoundPath(string res, string extName = "mp3")
- {
- return $"{SOUND_DIR_PATH}/Card/{res}.{extName}";
- }
- public static string GetMusicPath(string res, string extName = "mp3")
- {
- return $"{MUSIC_DIR_PATH}/{res}.{extName}";
- }
- public static string GetFontPath(string res, string extName = "TTF")
- {
- return $"{FONT_DIR_PATH}/{res}.{extName}";
- }
- public static string GetPrefabPath(string res, string extName = "prefab")
- {
- return $"{PREFAB_DIR_PATH}/{res}.{extName}";
- }
- public static string GetDressUpAnimationDirPath(string res)
- {
- return $"{ANIMATION_DIR_PATH}/DressUp/{res}";
- }
- public static string GetDressUpAnimationPath(string res, string extName = "prefab")
- {
- return $"{GetDressUpAnimationDirPath(res)}/{res}.{extName}";
- }
- public static bool CheckDressUpAnimationResExist(string res, string extName = "prefab")
- {
- if (string.IsNullOrEmpty(res))
- {
- return false;
- }
- string resPath = ResPathUtil.GetDressUpAnimationPath(res, extName);
- return VEngine.Versions.Contains(resPath);
- }
- public static string GetDressUpEffectDirPath(string res)
- {
- return $"{EFFECT_DIR_PATH}/DressUp/{res}";
- }
- public static string GetDressUpEffectPath(string res, bool inAniDir = false, string extName = "prefab")
- {
- if (inAniDir)
- {
- return $"{GetDressUpEffectDirPath(res)}/{res}_2.{extName}";
- }
- return $"{GetDressUpEffectDirPath(res)}/{res}.{extName}";
- }
- public static string GetViewEffectPath(string uiName, string resName, string extName = "prefab")
- {
- return $"{EFFECT_DIR_PATH}/UI/{uiName}/{resName}.{extName}";
- }
- public static string GetCardAnimationPath(string res, string extName = "prefab")
- {
- return $"{ANIMATION_DIR_PATH}/Card/{res}/{res}.{extName}";
- }
- public static string GetActivityPath(string res, string extName = "jpg")
- {
- return $"{TEXTURE_DIR_PATH}/Activity/Activity/{res}.{extName}";
- }
- public static string GetActivityShow1Path(string res, string extName = "jpg")
- {
- return $"{TEXTURE_DIR_PATH}/Activity/Show1/{res}.{extName}";
- }
- public static string GetActivityShow2Path(string res, string extName = "jpg")
- {
- return $"{TEXTURE_DIR_PATH}/Activity/Show1/{res}.{extName}";
- }
- public static string GetTravelBgPath(string res, string extName = "png")
- {
- return $"{TEXTURE_DIR_PATH}/Travel/Bg/{res}.{extName}";
- }
- public static string GetTravelRolePath(string res, string extName = "png")
- {
- return $"{TEXTURE_DIR_PATH}/Travel/Role/{res}.{extName}";
- }
- public static string GetHeadPath(string res, string extName = "png")
- {
- return $"{TEXTURE_DIR_PATH}/Head/Head/{res}.{extName}";
- }
- public static string GetHeadBorderPath(string res, string extName = "png")
- {
- if (string.IsNullOrEmpty(res)) return "";
- return $"{TEXTURE_DIR_PATH}/Head/HeadBorder/{res}.{extName}";
- }
- public static string GetShaderPath(string res)
- {
- return $"{Shader_DIR_PATH}/{res}.shader";
- }
- public static string GetLeagueIconPath(string res, string extName = "png")
- {
- return $"{TEXTURE_DIR_PATH}/LeagueIcon/{res}.{extName}";
- }
- }
- }
|