Interface IResourceImporter
Interface for all resource loaders.
public interface IResourceImporter
Remarks
Resource importers are expected to be thread safe.
Properties
ImporterExtensions
The file extensions for this resource importer.
IEnumerable<string> ImporterExtensions { get; }
Property Value
ImporterMimeTypes
The mime types for this resource importer.
IEnumerable<string> ImporterMimeTypes { get; }
Property Value
ResourceSystem
Set the resource system for this importer.
ResourceSystem ResourceSystem { set; }
Property Value
Methods
Import(Stream, EcsContainer?, string?)
Begins importing a resource in the given stream into the given ECS context.
Task<ResourceResult> Import(Stream source, EcsContainer? parent = null, string? fileName = null)
Parameters
source
StreamThe resource source stream.
parent
EcsContainerThe parent node for file types that contain a node hierarchy. If null, hierarchy is loaded into the root node.
fileName
stringBase name of the file.
Returns
- Task<ResourceResult>
A task that returns a reference to all the resources in the file.
IsImportable(ReadOnlySpan<byte>, string?)
Checks if this importer could import a stream with the given start bytes.
bool IsImportable(ReadOnlySpan<byte> page, string? fileName = null)
Parameters
page
ReadOnlySpan<byte>The start bytes of the resource stream.
fileName
stringThe name of the file, as a hint.
Returns
- bool
True if the importer could import this file.