public void Export(IAssetExportEnvironment env) { PythonScript input = env.Input as PythonScript; string outputPath = env.AddOutputPath(input.Name + SourceFileExtPrimary); SaveScriptData(input.Content, outputPath); }
public void PrepareExport(IAssetExportEnvironment env) { if (env.Input is PythonScript) { env.AddOutputPath(env.Input.Name + SourceFileExtPrimary); } }
void IAssetImporter.Export(IAssetExportEnvironment env) { T resource = env.Input as T; string outputPath = env.AddOutputPath(this.GetOutputNameFromResource(resource)); this.ExportResource(resource, outputPath, env); }
public void Export(IAssetExportEnvironment env) { // Determine input and output path CsvData input = env.Input as CsvData; string outputPath = env.AddOutputPath(input.Name + SourceFileExtPrimary); BaseAssetImporter.Export(input, outputPath); }
public void Export(IAssetExportEnvironment env) { // Determine input and output path Font input = env.Input as Font; string outputPath = env.AddOutputPath(input.Name + SourceFileExtPrimary); // Take the input Resource's TrueType font data and save it at the specified location File.WriteAllBytes(outputPath, input.EmbeddedTrueTypeFont); }
public void Export(IAssetExportEnvironment env) { //// Determine input and output path //Duality.Resources.Font input = env.Input as Duality.Resources.Font; //string outputPath = env.AddOutputPath(input.Name + ".fnt"); //// Take the input Resource's TrueType font data and save it at the specified location //File.WriteAllBytes(outputPath, input.EmbeddedTrueTypeFont); }
void IAssetImporter.PrepareExport(IAssetExportEnvironment env) { T resource = env.Input as T; if (resource != null && this.CanExport(resource)) { env.AddOutputPath(this.GetOutputNameFromResource(resource)); } }
public void Export(IAssetExportEnvironment env) { // Determine input and output path AudioData input = env.Input as AudioData; string outputPath = env.AddOutputPath(input.Name + SourceFileExtPrimary); // Take the input Resource's audio data and save it at the specified location File.WriteAllBytes(outputPath, input.OggVorbisData); }
public void Export(IAssetExportEnvironment env) { // Determine input and output path Pixmap input = env.Input as Pixmap; string outputPath = env.AddOutputPath(input.Name + SourceFileExtPrimary); // Take the input Resource's pixel data and save it at the specified location this.SavePixelData(input.MainLayer, outputPath); }
public void Export(IAssetExportEnvironment env) { // Determine input and output path JsonData input = env.Input as JsonData; string outputPath = env.AddOutputPath(input.Name + SourceFileExtPrimary); // Take the input Resource's pixel data and save it at the specified location BaseAssetImporter.Export(input, outputPath); }
public void PrepareExport(IAssetExportEnvironment env) { // We can export any Resource that is a Pixmap if (env.Input is Pixmap) { // Add the file path of the exported output we'll produce. env.AddOutputPath(env.Input.Name + SourceFileExtPrimary); } }
public void PrepareExport(IAssetExportEnvironment env) { // We can export any Resource that is a Font with an embedded TrueType face Font input = env.Input as Font; if (input != null && input.EmbeddedTrueTypeFont != null) { // Add the file path of the exported output we'll produce. env.AddOutputPath(env.Input.Name + SourceFileExtPrimary); } }
public void PrepareExport(IAssetExportEnvironment env) { //// We can export any Resource that is a Font with an embedded TrueType face //Duality.Resources.Font input = env.Input as Duality.Resources.Font; //if (input != null && input.EmbeddedTrueTypeFont != null) //{ // // Add the file path of the exported output we'll produce. // env.AddOutputPath(env.Input.Name + ".fnt"); //} }
public void PrepareExport(IAssetExportEnvironment env) { // We can export any Resource that is a shader if (env.Input is AbstractShader) { // Add the file path of the exported output we'll produce. if (env.Input is FragmentShader) env.AddOutputPath(env.Input.Name + SourceFileExtFragment); else env.AddOutputPath(env.Input.Name + SourceFileExtVertex); } }
/// <summary> /// Retrieves the value of an export parameter for the specified <see cref="Resource"/>. /// If the parameter was undefined, it will be (persistently) initialized with the specified default value. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="env"></param> /// <param name="parameterName">The name of the parameter.</param> /// <param name="defaultValue">If the value wasn't defined for the given Resource, the default value will be used instead.</param> /// <returns>The retrieved value, or the default value that was specified.</returns> public static T GetOrInitParameter <T>(this IAssetExportEnvironment env, string parameterName, T defaultValue) { T value; if (env.GetParameter <T>(parameterName, out value)) { return(value); } env.SetParameter <T>(parameterName, defaultValue); return(defaultValue); }
public void PrepareExport(IAssetExportEnvironment env) { // We can export any Resource that is a shader if (env.Input is AbstractShader) { // Add the file path of the exported output we'll produce. if (env.Input is FragmentShader) { env.AddOutputPath(env.Input.Name + SourceFileExtFragment); } else { env.AddOutputPath(env.Input.Name + SourceFileExtVertex); } } }
public void Export(IAssetExportEnvironment env) { // Determine input and output path AbstractShader input = env.Input as AbstractShader; string outputPath; if (env.Input is FragmentShader) { outputPath = env.AddOutputPath(input.Name + SourceFileExtFragment); } else { outputPath = env.AddOutputPath(input.Name + SourceFileExtVertex); } // Take the input Resource's TrueType font data and save it at the specified location File.WriteAllText(outputPath, input.Source); }
// Export is not supported void IAssetImporter.PrepareExport(IAssetExportEnvironment env) { }
void IAssetImporter.Export(IAssetExportEnvironment env) { }
public void Export(IAssetExportEnvironment env) { // Determine input and output path AbstractShader input = env.Input as AbstractShader; string outputPath; if (env.Input is FragmentShader) outputPath = env.AddOutputPath(input.Name + SourceFileExtFragment); else outputPath = env.AddOutputPath(input.Name + SourceFileExtVertex); // Take the input Resource's TrueType font data and save it at the specified location File.WriteAllText(outputPath, input.Source); }
/// <summary> /// Performs the export operation for a resource. /// </summary> /// <param name="resourceRef">A <see cref="ContentRef{T}"/> pointing to the resource being imported.</param> /// <param name="path">The export path for the resource</param> /// <param name="env">The input environment in which the import is taking place.</param> protected abstract void ExportResource(ContentRef <T> resourceRef, string path, IAssetExportEnvironment env);
protected override void ExportResource(ContentRef <AudioData> resourceRef, string path, IAssetExportEnvironment env) { AudioData resource = resourceRef.Res; // Take the input Resource's audio data and save it at the specified location File.WriteAllBytes(path, resource.OggVorbisData); }
protected override void ExportResource(ContentRef <DualityFont> resourceRef, string path, IAssetExportEnvironment env) { }
public void Export(IAssetExportEnvironment env) { // Determine input and output path AudioData input = env.Input as AudioData; string outputPath = env.AddOutputPath(input.Name + SourceFileExtPrimary); WAVExporter.SaveVorbisDataToWAV(input.OggVorbisData, outputPath); }
protected override void ExportResource(ContentRef <Pixmap> resourceRef, string path, IAssetExportEnvironment env) { Pixmap resource = resourceRef.Res; // Take the input Resource's pixel data and save it at the specified location this.SavePixelData(resource.MainLayer, path); }