Пример #1
0
    static AssetBundleMD5Info GetMD5FromAssets(List <string> assets, string bundlePath)
    {
        AssetBundleMD5Info info = new AssetBundleMD5Info();

        info.bundleName = bundlePath;

        if (assets == null || assets.Count < 1)
        {
            return(info);
        }

        for (int i = 0; i < assets.Count; i++)
        {
            string md5 = MD5Utils.GetMD5FromFile(assets[i]);
            info.AddAssets(assets[i], md5);
        }

        return(info);
    }
Пример #2
0
    public static string GetBundleMD5(string bundlePath)
    {
        if (string.IsNullOrEmpty(bundlePath) || !File.Exists(bundlePath))
        {
            return("");
        }

        List <string> assets       = GetBundleAssets(bundlePath);
        List <string> depth_assets = GetBundleAssetsDepths(assets);

        if (depth_assets == null || depth_assets.Count < 1)
        {
            return("");
        }

        AssetBundleMD5Info info = GetMD5FromAssets(depth_assets, bundlePath);

        info.Compute();

        md5List.Add(info);

        return(info.md5);
    }