예제 #1
0
    static void EncryptAndCopyFile(string excelName, ExcelDirType dirType)
    {
        string name       = excelName.ToLower();
        string bundleName = ExcelConfig.GetBundleName(dirType, name);
        string src        = Path.Combine(Path.Combine(Application.dataPath, _buildOutputPath), bundleName);
        string dest       = Path.Combine(Path.Combine(Application.dataPath, _streamingPath), bundleName);

        if (File.Exists(src))
        {
            byte[] originalBytes  = File.ReadAllBytes(src);
            byte[] encryptedBytes = null;
            if (AssetConfig.IsExcelAssetBundleEncrypted)
            {
                encryptedBytes = EncryptUtility.AES_Encrypt(originalBytes);
            }
            else
            {
                encryptedBytes = originalBytes;
            }
            File.WriteAllBytes(dest, encryptedBytes);
        }
        else
        {
            //Debug.LogError("EncryptAndCopyFile fail: file doesn't exist: " + src);
        }
    }
예제 #2
0
    static bool BuildSingleExcel(PlatformType platform, BuildTarget target, string excelName, string outputPath, ExcelDirType dirType)
    {
        List <string> allResPaths = BuildAssetBundleHelper.GetSingleExcelResourcePaths(dirType, excelName);
        string        bundleName  = ExcelConfig.GetBundleName(dirType, excelName);
        bool          result      = BuildAssetBundles.BuildBundlesFromMap(outputPath, "", platform, target, false, bundleName, allResPaths);

        if (!result)
        {
            Debug.Log("Warn: Fail to build excel: " + excelName);
        }

        return(result);
    }