public static void Export(string path, string name, Texture2D texture, bool forRelease, UTinyTextureSettings settings, List <FileInfo> output) { switch (settings.FormatType) { case TextureFormatType.Source: // Use the basic file exporter FileExporter.Export(path, name, texture, output); break; case TextureFormatType.PNG: ExportPng(path, name, texture, output); break; case TextureFormatType.JPG: if (forRelease) { ExportJpgOptimized(path, name, texture, settings.JpgCompressionQuality, output); } else { ExportJpg(path, name, texture, settings.JpgCompressionQuality, output); } break; case TextureFormatType.WebP: ExportWebP(path, name, texture, settings.WebPCompressionQuality, output); break; default: throw new ArgumentOutOfRangeException(); } }
private static UTinyExportInfo Export(UTinyProject project, string path, UTinyAssetInfo assetInfo) { var export = new UTinyExportInfo(assetInfo); var assetName = GetAssetName(project, assetInfo.Object); var isDebug = UTinyEditorApplication.EditorContext.Workspace.BuildConfiguration == UTinyBuildConfiguration.Debug; var texture = assetInfo.Object as Texture2D; if (texture != null) { var settings = UTinyUtility.GetAssetExportSettings(project, texture) as UTinyTextureSettings; TextureExporter.Export(path, assetName, texture, !isDebug, settings, export.Exported); return(export); } var audioClip = assetInfo.Object as AudioClip; if (audioClip != null) { FileExporter.Export(path, assetName, audioClip, export.Exported); return(export); } var font = assetInfo.Object as Font; if (font != null) { FontExporter.Export(path, assetName, font, export.Exported); return(export); } // Export the object as is FileExporter.Export(path, assetName, assetInfo.Object, export.Exported); return(export); }
public static void ExportRouteFiles( IMessageDisplay view, RouteGroup Route, IEnumerable <ExportCommand> cmds, AirportManager airportList) { if (Route == null) { view.ShowMessage("Please find or analyze a route first.", MessageLevel.Info); return; } var writer = new FileExporter(Route.Expanded, airportList, cmds); IEnumerable <FileExporter.Status> reports = null; try { reports = writer.Export(); } catch (Exception ex) { view.ShowMessage(ex.Message, MessageLevel.Warning); return; } ShowReports(view, reports.ToList()); }
private void ExportRouteFiles(object sender, EventArgs e) { if (Route == null) { parentForm.ShowWarning("Please find or analyze a route first."); return; } var cmds = AppSettings.ExportCommands.Values; var writer = new FileExporter(Route.Expanded, AirportList, cmds); IEnumerable <FileExporter.Status> reports = null; try { reports = writer.Export(); } catch (Exception ex) { parentForm.ShowWarning(ex.Message); return; } ShowReports(reports.ToList()); }
public static void Export(string path, string name, Font font, ICollection <FileInfo> output) { if (IncludedByTargetPlatform(font)) { return; } FileExporter.Export(path, name, font, output); }
private void ExportFiles(object sender, EventArgs e) { var o = UpdatedOption(); UpdateOption(o); var writer = new FileExporter(Route.Expanded, AirportList, o.ExportCommands, () => appOption.Instance); IEnumerable <FileExporter.Status> reports = null; try { reports = writer.Export(); } catch (Exception ex) { this.ShowMessage(ex.Message, MessageLevel.Warning); return; } ShowReports(this, reports.ToList()); }