Ejemplo n.º 1
0
        protected override void Prepare(AssetCompilerContext context, AssetItem assetItem, string targetUrlInStorage, AssetCompilerResult result)
        {
            var asset = (RawAsset)assetItem.Asset;

            // Get absolute path of asset source on disk
            var assetSource   = GetAbsolutePath(assetItem, asset.Source);
            var importCommand = new ImportStreamCommand(targetUrlInStorage, assetSource)
            {
                DisableCompression = !asset.Compress
            };

            result.BuildSteps = new AssetBuildStep(assetItem);
            result.BuildSteps.Add(importCommand);
        }
Ejemplo n.º 2
0
        protected override void Compile(AssetCompilerContext context, string urlInStorage, UFile assetAbsolutePath, RawAsset asset, AssetCompilerResult result)
        {
            if (!EnsureSourceExists(result, asset, assetAbsolutePath))
            {
                return;
            }

            // Get absolute path of asset source on disk
            var assetSource   = GetAbsolutePath(assetAbsolutePath, asset.Source);
            var importCommand = new ImportStreamCommand(urlInStorage, assetSource)
            {
                DisableCompression = !asset.Compress
            };

            result.BuildSteps = new AssetBuildStep(AssetItem)
            {
                importCommand
            };
        }