Example #1
0
        /// <summary>
        /// 执行构建
        /// </summary>
        private void ExecuteBuild()
        {
            string          defaultOutputRoot = AssetBundleBuilderHelper.GetDefaultOutputRoot();
            BuildParameters buildParameters   = new BuildParameters();

            buildParameters.OutputRoot           = defaultOutputRoot;
            buildParameters.BuildTarget          = _buildTarget;
            buildParameters.BuildMode            = (EBuildMode)_buildModeField.value;
            buildParameters.BuildVersion         = _buildVersionField.value;
            buildParameters.BuildinTags          = _buildinTagsField.value;
            buildParameters.VerifyBuildingResult = true;
            buildParameters.EnableAddressable    = AssetBundleCollectorSettingData.Setting.EnableAddressable;
            buildParameters.AppendFileExtension  = _appendExtensionToggle.value;
            buildParameters.CopyBuildinTagFiles  = _copyBuildinTagFilesToggle.value;
            buildParameters.EncryptionServices   = CreateEncryptionServicesInstance();
            buildParameters.CompressOption       = (ECompressOption)_compressionField.value;

            AssetBundleBuilder builder = new AssetBundleBuilder();

            builder.Run(buildParameters);
        }
Example #2
0
        /// <summary>
        /// 模拟构建
        /// </summary>
        public static void SimulateBuild()
        {
            string          defaultOutputRoot = AssetBundleBuilderHelper.GetDefaultOutputRoot();
            BuildParameters buildParameters   = new BuildParameters();

            buildParameters.OutputRoot        = defaultOutputRoot;
            buildParameters.BuildTarget       = EditorUserBuildSettings.activeBuildTarget;
            buildParameters.BuildMode         = EBuildMode.SimulateBuild;
            buildParameters.BuildVersion      = 999;
            buildParameters.EnableAddressable = AssetBundleCollectorSettingData.Setting.EnableAddressable;

            AssetBundleBuilder builder = new AssetBundleBuilder();
            bool buildResult           = builder.Run(buildParameters);

            if (buildResult)
            {
                string pipelineOutputDirectory = AssetBundleBuilderHelper.MakePipelineOutputDirectory(buildParameters.OutputRoot, buildParameters.BuildTarget);
                _manifestFilePath = $"{pipelineOutputDirectory}_{EBuildMode.SimulateBuild}/{YooAssetSettingsData.GetPatchManifestFileName(buildParameters.BuildVersion)}";
            }
            else
            {
                _manifestFilePath = null;
            }
        }