Esempio n. 1
0
        internal static IReadOnlyDictionary <AssetInfo, Entity> Export(BuildPipeline.BuildContext context)
        {
            var project       = context.Project;
            var assetExporter = new AssetExporter(project.Session);

            var assets = assetExporter.AssetManager.EnumerateAssets(project);

            foreach (var pair in assets)
            {
                assetExporter.Export(pair.Key, pair.Value, context);
            }

            return(assets);
        }
Esempio n. 2
0
        public override IEnumerable <FileInfo> Export(FileInfo outputFile, UnityEngine.Texture2D texture)
        {
            var settings   = Texture2DAsset.GetSettings(texture);
            var formatType = Texture2DAsset.RealFormatType(texture, settings);

            switch (formatType)
            {
            case TextureFormatType.Source:
                return(AssetExporter.ExportSource(outputFile, texture));

            case TextureFormatType.PNG:
                return(ExportPng(outputFile, texture));

            case TextureFormatType.JPG:
                //return ExportJpg(outputFile, Object, settings.JpgCompressionQuality);
                return(ExportJpgOptimized(outputFile, texture, settings.JpgCompressionQuality));

            case TextureFormatType.WebP:
                return(ExportWebP(outputFile, texture, settings.WebPCompressionQuality));

            default:
                throw new InvalidEnumArgumentException(nameof(formatType), (int)formatType, formatType.GetType());
            }
        }
Esempio n. 3
0
 public override IEnumerable <FileInfo> Export(FileInfo outputFile, UnityEngine.Video.VideoClip clip)
 {
     return(AssetExporter.ExportSource(outputFile, clip));
 }