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());
            }
        }
示例#2
0
 public override IEnumerable <FileInfo> Export(FileInfo outputFile, UnityEngine.Video.VideoClip clip)
 {
     return(AssetExporter.ExportSource(outputFile, clip));
 }