示例#1
0
 //=================================
 // 関数
 //=================================
 public void OnProcess(RuntimePlatform platform, BuildTarget target, IBundleBuildConfig config, IList <IBundleFileManifest> bundleList)
 {
     using (var scope = new CalcProcessTimerScope(this.GetType().Name))
     {
         DoProcess(platform, target, config, bundleList);
     }
 }
示例#2
0
        //============================================
        //	関数
        //============================================

        /// <summary>
        /// ビルド
        /// </summary>
        public virtual ABBuildResult Build(RuntimePlatform platform, BuildTarget target)
        {
            Context = new BuildContext();
            PreProcess?.SetContext(Context);
            BuildProcess?.SetContext(Context);
            PostProcess?.SetContext(Context);

            //  ビルド対象アセットの絞り込み
            IReadOnlyList <string> buildAssets = null;

            using (var timer = new CalcProcessTimerScope("Filter Assets"))
            {
                buildAssets = FileCollection.GetFiles();;
            }
            IList <IBundlePackRule> packageGroup = null;

            using (var timer = new CalcProcessTimerScope("CreatePackageList"))
            {
                packageGroup = RuleBuilder.GetPackRuleList();
            }
            //	ビルドマップの生成
            IList <IBundleFileManifest> assetBundleList = null;

            using (var timer = new CalcProcessTimerScope("Build BundleList"))
            {
                assetBundleList = Calclater.CreatePackageList(Config, buildAssets, packageGroup);
            }
            //  事前処理
            using (var timer = new CalcProcessTimerScope("Run PreProcess"))
            {
                PreProcess?.OnProcess(platform, target, Config, assetBundleList);
            }
            //	ビルド実行
            ABBuildResult result = default;

            using (var timer = new CalcProcessTimerScope("Run Build Process"))
            {
                result = BuildProcess.Build(platform, target, Config, assetBundleList);
            }
            using (var timer = new CalcProcessTimerScope("Run Post Process"))
            {
                //	事後処理
                PostProcess?.OnProcess(platform, target, Config, result, assetBundleList);
            }

            AssetDatabase.Refresh();

            return(result);
        }
示例#3
0
        //=========================================
        // Method
        //=========================================

        /// <summary>
        /// ビルド
        /// </summary>
        public virtual ABBuildResult Build(
            RuntimePlatform platform,
            BuildTarget target,
            IBundleBuildConfig settings,
            IList <IBundleFileManifest> assetBundleList
            )
        {
            var outputPath = m_outputPath.Get(platform);

            if (!Directory.Exists(outputPath.BasePath))
            {
                Directory.CreateDirectory(outputPath.BasePath);
            }

            var option     = settings.Options;
            var bundleList = assetBundleList
                             .Select(d => d.ToBuildEntry())
                             .ToArray();

            using (var scope = new CalcProcessTimerScope(this.GetType().Name))
            {
                return(DoBuild(platform, target, option, bundleList));
            }
        }