public void PrepareImport(IAssetImportEnvironment env) { foreach (AssetImportInput input in env.HandleAllInput(AcceptsInput)) { env.AddOutput <PythonScript>(input.AssetName, input.Path); } }
public void PrepareImport(IAssetImportEnvironment env) { // Ask to handle all input that matches the conditions in AcceptsInput foreach (AssetImportInput input in env.HandleAllInput(this.AcceptsInput)) { // For all handled input items, specify which Resource the importer intends to create / modify env.AddOutput <DualityFont>(input.AssetName, input.Path); } }
public void PrepareImport(IAssetImportEnvironment env) { // Ask to handle all input that matches the conditions in AcceptsInput foreach (AssetImportInput input in env.HandleAllInput(this.AcceptsInput)) { // For all handled input items, specify which Resource the importer intends to create / modify env.AddOutput<Pixmap>(input.AssetName, input.Path); } }
public void PrepareImport(IAssetImportEnvironment env) { // Ask to handle all input that matches the conditions in AcceptsInput foreach (AssetImportInput input in env.HandleAllInput(this.AcceptsInput)) { // For all handled input items, specify which Resource the importer intends to create / modify env.AddOutput <PlainTextData>(input.AssetName, input.Path); global::Duality.Log.Editor.WriteWarning(""); } }
public void PrepareImport(IAssetImportEnvironment env) { // Ask to handle all input that matches the conditions in AcceptsInput foreach (AssetImportInput input in env.HandleAllInput(this.AcceptsInput)) { // For all handled input items, specify which Resource the importer intends to create / modify string ext = Path.GetExtension(input.Path); if (string.Equals(ext, SourceFileExtVertex, StringComparison.InvariantCultureIgnoreCase)) env.AddOutput<VertexShader>(input.AssetName, input.Path); else env.AddOutput<FragmentShader>(input.AssetName, input.Path); } }
public void PrepareImport(IAssetImportEnvironment env) { // File all fnt files with allocated png files var importFiles = from file in env.HandleAllInput(f => Path.GetExtension(f.Path).ToLower() == ".fnt" || Path.GetExtension(f.Path).ToLower() == ".xml") select file; foreach (var input in importFiles) { var fileFormat = FigureOutFontFileFormat(input.Path); switch (fileFormat) { case FontFileFormat.None: { // Not a file format we support, ignore continue; } case FontFileFormat.BMFont: { var fontData = LoadBMFontData(input.Path); if (fontData.Pages.Count() > 1) { Log.Editor.WriteError("Only single page bitmap font files are allowed"); continue; //skip this file } env.AddOutput <Duality.Resources.Font>(input.AssetName, input.Path); foreach (var page in fontData.Pages) { var fullPath = Path.Combine(Path.GetDirectoryName(input.Path), page.File); if (File.Exists(fullPath)) { env.AddOutput <Pixmap>(input.AssetName, fullPath); } else { Log.Editor.WriteError("Corresponding bitmap font page file '{0}' not found ", fullPath); continue; //skip this file } } break; } } } }
public void PrepareImport(IAssetImportEnvironment env) { // Ask to handle all input that matches the conditions in AcceptsInput foreach (AssetImportInput input in env.HandleAllInput(this.AcceptsInput)) { // For all handled input items, specify which Resource the importer intends to create / modify string ext = Path.GetExtension(input.Path); if (string.Equals(ext, SourceFileExtVertex, StringComparison.InvariantCultureIgnoreCase)) { env.AddOutput <VertexShader>(input.AssetName, input.Path); } else { env.AddOutput <FragmentShader>(input.AssetName, input.Path); } } }