示例#1
0
        public void Export(IAssetExportEnvironment env)
        {
            PythonScript input      = env.Input as PythonScript;
            string       outputPath = env.AddOutputPath(input.Name + SourceFileExtPrimary);

            SaveScriptData(input.Content, outputPath);
        }
示例#2
0
 public void PrepareExport(IAssetExportEnvironment env)
 {
     if (env.Input is PythonScript)
     {
         env.AddOutputPath(env.Input.Name + SourceFileExtPrimary);
     }
 }
示例#3
0
        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);
        }
示例#5
0
		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);
        }
示例#7
0
        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
            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);
        }
示例#11
0
        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);
        }
示例#12
0
        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);
        }
示例#13
0
 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);
     }
 }
示例#14
0
        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);
        }
示例#15
0
		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);
			}
		}
示例#16
0
		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 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);
            }
        }
示例#19
0
		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);
        }
示例#21
0
 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);
         }
     }
 }
示例#22
0
        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);
        }
示例#23
0
 // Export is not supported
 void IAssetImporter.PrepareExport(IAssetExportEnvironment env)
 {
 }
示例#24
0
 void IAssetImporter.Export(IAssetExportEnvironment env)
 {
 }
示例#25
0
 // Export is not supported
 void IAssetImporter.PrepareExport(IAssetExportEnvironment env)
 {
 }
示例#26
0
		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);
		}
示例#27
0
 /// <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);
示例#28
0
 void IAssetImporter.Export(IAssetExportEnvironment env)
 {
 }
示例#29
0
        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);
        }
示例#30
0
 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);
        }
示例#32
0
        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);
        }