Пример #1
0
    private static void GenericBuild(string[] scenes, string target_dir, BuildTarget build_target, BuildOptions build_options)
    {
        AssetDatabase.Refresh();

        bool needEncrypt = false;

        if (needEncrypt)
        {
            string        strOutputPath = Path.GetFullPath(Path.Combine(Application.streamingAssetsPath, PathUtil.Platform));
            DirectoryInfo dir           = new DirectoryInfo(strOutputPath);
            if (dir.Exists)
            {
                dir.Delete(true);
            }
            AssetDatabase.Refresh();

            GenerateObfuscatedCode.GenerateCodes();
            AssetDatabase.Refresh();
        }

        ExportAssetBundle.BuildAssetBundles();
        ExportAssetBundle.ExportLua();

        if (needEncrypt)
        {
            ExportAssetBundle.EncryptAssetBundle();
        }

        ExportAssetBundle.GenerateVersion();

        BuildReport  res     = BuildPipeline.BuildPlayer(scenes, target_dir, build_target, build_options);
        BuildSummary summary = res.summary;

        if (summary.result == BuildResult.Failed)
        {
            throw new Exception("BuildPlayer failure: " + res.ToString());
        }
    }
Пример #2
0
 public static void GenerateVersion()
 {
     ExportAssetBundle.GenerateVersion();
 }