/// <summary> /// 获取BundleName带语言后缀名 /// </summary> /// <param name="lang"></param> /// <returns></returns> public string GetBundleFileNameWithLangExtension(eAssetLanguageVarType lang) { if (hasOtherLanguage) { return(AssetI8NHelper.GetLangBundleStr(bundleFileName, lang) + BundleExtension); } else { return(bundleFileName + BundleExtension); } }
/// <summary> /// 获取BundleName带语言后缀名 /// </summary> /// <param name="lang"></param> /// <returns></returns> public string GetBundleNameWithLangExtension(eAssetLanguageVarType lang) { if (hasOtherLanguage) { return(AssetI8NHelper.GetLangBundleStr(bundleNameMD5Struct.GetMD5Str(!isComplexName), lang)); } else { return(bundleNameMD5Struct.GetMD5Str(!isComplexName)); } }
public static string GetLangBundleVariantStr(eAssetLanguageVarType t) { switch (t) { case eAssetLanguageVarType.TW: return("tw"); case eAssetLanguageVarType.KR: return("kr"); case eAssetLanguageVarType.JP: return("jp"); case eAssetLanguageVarType.EN: return("en"); default: return("default"); } }
/// <summary> /// 根据XMLtable表检查出需要下载的bundle /// </summary> /// <param name="table"></param> /// <returns></returns> public static List <string> GetBundleNeedDownLoadList(AssetBundleTable table, eAssetLanguageVarType lanType) { var list = new List <string>(); if (table != null) { foreach (var x in table.BundleInfos) { //检查Persist var has = AssetBundlePathResolver.CheckBundleExistInPersisten( x.GetBundleFileNameWithLangExtension(lanType)); //然后检查Stream if (!has) { has = AssetBundlePathResolver.CheckBundleExistInStreaming( x.GetBundleFileNameWithLangExtension(lanType)); } if (!has) { list.Add(x.GetBundleFileNameWithLangExtension(lanType)); } } } return(list); }
public static string GetLangBundleStr(string bundleName, eAssetLanguageVarType t) { return(bundleName + "." + GetLangBundleVariantStr(t)); }
/// <summary> /// 获取对应语言文件后缀名 /// </summary> /// <param name="t"></param> /// <returns></returns> public static string GetLangFileExtensionStr(eAssetLanguageVarType t) { return(t == eAssetLanguageVarType.Default ? "" : "." + GetLangBundleVariantStr(t)); }