예제 #1
0
        private ResVersion GetNeedDownloadResVersion(ResVersion remoteResVersion)
        {
            var needDownloadResVersion = new ResVersion();

            for (int i = 0; i < remoteResVersion.AssetBundleNames.Count; i++)
            {
                var tmpBundlePath = string.Format("{0}{1}", Config.HotUpdateAssetBundlesFolder, remoteResVersion.AssetBundleNames[i]);

                if (File.Exists(tmpBundlePath))
                {
                    if (!FileMD5Tools.MD5Stream(tmpBundlePath).Equals(remoteResVersion.AssetBundleMD5s[i]))
                    {
                        File.Delete(tmpBundlePath);

                        needDownloadResVersion.AssetBundleNames.Add(remoteResVersion.AssetBundleNames[i]);
                    }
                    else
                    {
                        Debug.Log("MD5相同,下一个");
                    }
                }
                else
                {
                    needDownloadResVersion.AssetBundleNames.Add(remoteResVersion.AssetBundleNames[i]);
                }
            }

            return(needDownloadResVersion);
        }
예제 #2
0
        private static List <string> GetAssetBundleMD5s(string outputPath)
        {
            var AssetBundleNames = AssetDatabase.GetAllAssetBundleNames();
            var AssetBundleMD5s  = new List <string>();

            for (int i = 0; i < AssetBundleNames.Length; i++)
            {
                var bundlePath = string.Format("{0}/{1}", outputPath, AssetBundleNames[i]);
                if (File.Exists(bundlePath) && !HotUpdateStaticConfig.UnrecordBundleName.Contains(AssetBundleNames[i]))
                {
                    var bundleMD5Str = FileMD5Tools.MD5Stream(bundlePath);
                    AssetBundleMD5s.Add(bundleMD5Str);
                }
            }

            return(AssetBundleMD5s);
        }