Exemplo n.º 1
0
        public override void Run(BuildActionContext context)
        {
            if (Arguments == null || Arguments.Length == 0)
            {
                ToolDebug.Warning("No item specified for process");
                return;
            }

            if (Arguments.Length < 2)
            {
                ToolDebug.Warning("No resource specified {0}", Arguments[1]);
                return;
            }

            string processName  = Arguments[1];
            string resourcePath = Arguments[2];

            var process = BuilderAssetDB.GetItem(processName);

            if (process == null)
            {
                ToolDebug.Warning("No process found {0}", processName);
                return;
            }

            //if (process.Object == null)
            //{
            //    ToolDebug.Warning("Invalid process item found {0}", processName);
            //    return;
            //}

            var resourceAssetItem = BuilderAssetDB.AddOrGetAsset(resourcePath);

            if (resourceAssetItem == null)
            {
                ToolDebug.Warning("No resource found {0}", resourcePath);
                return;
            }

            if (context.CurrentBuildPipeline == null)
            {
                ToolDebug.Warning("Invalid buildpipeline item found {0}", processName);
                return;
            }

            //var buildPipeline = resourceAssetItem.BuildPipeline[context.CurrentTarget];
            //var orgImporterObject = process.Object as BuildProcessor;
            //var childImporter = orgImporterObject.Clone();

            //buildPipeline.ProcessorList.Add(childImporter);

            //// copy rest argument
            //for (int iConfig = 3; iConfig < Arguments.Length; iConfig++)
            //{
            //    childImporter.Parameters.Add(Arguments[iConfig]);
            //}
        }
Exemplo n.º 2
0
        public override void Run(BuildActionContext context)
        {
            if (Arguments == null || Arguments.Length == 0)
            {
                ToolDebug.Warning("No item specified for process");
                return;
            }

            if (Arguments.Length < 2)
            {
                ToolDebug.Warning("No resource specified {0}", Arguments[1]);
                return;
            }

            string processName  = Arguments[1];
            string resourcePath = Arguments[2];

            var process = BuilderAssetDB.GetItem(processName);

            if (process == null)
            {
                ToolDebug.Warning("No process found {0}", processName);
                return;
            }

            //if (process.Object == null)
            //{
            //    ToolDebug.Warning("Invalid process item found {0}", processName);
            //    return;
            //}

            var resourceAssetItem = BuilderAssetDB.AddOrGetAsset(resourcePath);

            if (resourceAssetItem == null)
            {
                ToolDebug.Warning("No resource found {0}", resourcePath);
                return;
            }

            //AssetProcessor processor = BuilderAssetDB.Instance.GetProcessorFor(context.Target, resourceAssetItem, destType);
            //if (processor == null)
            //{
            //    ToolDebug.Error("No processor found {0}", resourcePath);
            //    return;
            //}

            // TODO: copy rest argument
            // Arguments need to be pair of name:value such as setting set
            //for (int iConfig = 3; iConfig < Arguments.Length; iConfig++)
            //{
            //    childImporter.Parameters.Add(Arguments[iConfig]);
            //}
        }