private static void BuildAbManifest() { var assetBundle = AssetBundle.LoadFromFile($"{PathUtility.GetAbOutPath()}/{PathUtility.GetPlatformName()}"); var manifest = assetBundle.LoadAsset(AbDefine.assetbundleManifest) as AssetBundleManifest; if (manifest != null) { var abManifest = new AbManifest(); var assetBundles = manifest.GetAllAssetBundles(); abManifest.abInfos = new AbInfo[assetBundles.Length]; for (int i = 0; i < assetBundles.Length; i++) { var abName = assetBundles[i]; var abHash = manifest.GetAssetBundleHash(abName); var abInfo = new AbInfo { abHash = abHash.ToString(), abSize = (ulong)new FileInfo($"{PathUtility.GetAbOutPath()}/{abName}").Length }; abManifest.abInfos[i] = abInfo; } File.WriteAllText($"{PathUtility.GetAbOutPath()}/manifest", JsonUtility.ToJson(abManifest)); AssetDatabase.Refresh(); } }
public static void update_ab_info_db(string dbfile) { DbRepository <AbInfo> temp_db; temp_db = new DbRepository <AbInfo>(); temp_db.DataService(dbfile); temp_db.CreateTable(); IEnumerable <AbInfo> res = temp_db.Select <AbInfo>((temp_fbx) => { if (temp_fbx.ab_name != "") { return(true); } else { return(false); } }); if (res.GetEnumerator().MoveNext()) { DbRepository <AbInfo> anim_db; anim_db = new DbRepository <AbInfo>(); anim_db.DataService("vesali.db"); foreach (AbInfo item in res) { AbInfo fbx_info = anim_db.SelectOne <AbInfo>((temp_fbx_anim) => { if (temp_fbx_anim.ab_name == item.ab_name) { return(true); } else { return(false); } }); if (fbx_info != null) { anim_db.Update(item); } else { anim_db.Insert(item); } } anim_db.Close(); } temp_db.Close(); }