예제 #1
0
    static void AddBundleInfo(string bundleName, ref FileList filelist)
    {
        if (string.IsNullOrEmpty(bundleName))
        {
            return;
        }

        string bundlePath = string.Format("{0}/{1}", PackAssetBundle.bundleBuildFolder, bundleName);

        uint crc = 0;

        if (!BuildPipeline.GetCRCForAssetBundle(bundlePath, out crc))
        {
            return;
        }

        FileInfo fileInfo = new FileInfo(bundlePath);
        UInt32   size     = (UInt32)fileInfo.Length;
        string   md5      = "";

        if (string.Equals(bundleName, ResourceConst.PkgBundleFolder))
        {
            md5 = MD5Utils.GetMD5(bundlePath);
        }
        else
        {
            md5 = FileDepencies.GetBundleMD5(bundlePath);
        }

        filelist.AddBundleInfo(bundleName, crc, size, md5);
    }
예제 #2
0
    static void AddConfInfo(FileList filelist)
    {
        if (filelist == null)
        {
            return;
        }

        string confFolder = string.Format("{0}/{1}", PackAssetBundle.bundleBuildFolder, ResourceConst.ConfFolder);

        string[] files = Directory.GetFiles(confFolder);
        foreach (string file in files)
        {
            string fileName = Path.GetFileName(file);


            string bundleName = string.Format("{0}/{1}", ResourceConst.ConfFolder, fileName);

            uint crc = FileToCRC32.GetFileCRC32Int(file);

            FileInfo fileInfo = new FileInfo(file);
            UInt32   size     = (UInt32)fileInfo.Length;
            string   md5      = MD5Utils.GetMD5(file);

            filelist.AddBundleInfo(bundleName, crc, size, md5);
        }
    }