Skip to content

API reference

Interface IAssetImporter

Namespace: MicroEngine.Content
Assembly: MicroEngine.Content.dll
Guide: Assets

Reserved: a build-time step that turns a source file into the file a loader reads (a texture compressed for the GPU, a model converted from glTF, a font baked into a distance field), driven by settings kept next to the source file. The engine does not call importers yet; the interface fixes where that step will plug in so loaders never need to change when it arrives. Content stays usable without any importer: loaders read source files directly.

C#
public interface IAssetImporter

Properties

Name

A name for the import step, for diagnostics and settings files.

C#
string Name { get; }

Property Value

string

SourceExtensions

The source file extensions it imports (lower case, with the dot).

C#
IReadOnlyList<string> SourceExtensions { get; }

Property Value

IReadOnlyList<string>

Methods

Import(string, Stream, IReadOnlyDictionary<string, string>, Stream)

Writes the imported form of source to output.

C#
void Import(string sourcePath, Stream source, IReadOnlyDictionary<string, string> settings, Stream output)

Parameters

sourcePath string

The source file’s content path.

source Stream

The source file.

settings IReadOnlyDictionary<string, string>

The import settings kept next to the source, by name.

output Stream

Where the imported file is written.