private static BundleDetailConfig CreateBundleDetailConfig(CompatibilityAssetBundleManifest manifest)
        {
            List <BundleDetail> details = new List <BundleDetail>();

            string[] bundles = manifest.GetAllAssetBundles();
            foreach (var bundlePath in bundles)
            {
                BundleDetail detail = new BundleDetail();
                detail.Path         = bundlePath;
                detail.Hash         = manifest.GetAssetBundleHash(bundlePath).ToString();
                detail.CRC          = manifest.GetAssetBundleCrc(bundlePath).ToString();
                detail.Dependencies = manifest.GetAllDependencies(bundlePath);

                details.Add(detail);
            }
            BundleDetailConfig detailConfig = new BundleDetailConfig();

            detailConfig.Details = details.ToArray();

            return(detailConfig);
        }
Exemplo n.º 2
0
    private static AssetBundleConfig ConvertToBundleConfig(AssetPackerConfig assetPackerConfig, CompatibilityAssetBundleManifest manifest, string outputDir)
    {
        AssetBundleConfig assetBundleConfig = new AssetBundleConfig();

        List <AssetBundleDetail> bundleDetails = new List <AssetBundleDetail>();

        string[] bundles = manifest.GetAllAssetBundles();
        foreach (var bundlePath in bundles)
        {
            AssetBundleDetail detail = new AssetBundleDetail();
            detail.path         = bundlePath;
            detail.hash         = manifest.GetAssetBundleHash(bundlePath).ToString();
            detail.crc          = manifest.GetAssetBundleCrc(bundlePath).ToString();
            detail.dependencies = manifest.GetAllDependencies(bundlePath);

            string bundleDiskPath = $"{outputDir}/{bundlePath}";
            detail.md5 = MD5Crypto.Md5File(bundleDiskPath);

            bundleDetails.Add(detail);
        }
        assetBundleConfig.details = bundleDetails.ToArray();

        return(assetBundleConfig);
    }