Skip to content

Class ImportContext

Namespace: Apogee.Content.Import
Assembly: Apogee.Content.dll

An asset being imported: its bytes, its settings, and the files it reads, which become the artifact's dependencies.

public sealed class ImportContext

Inheritance

object ← ImportContext

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

Properties

Bytes

public byte[] Bytes { get; }

Property Value

byte[]

PhysicalRoot

The folder on disk that res:// is; null when the project is not a plain folder.

public string? PhysicalRoot { get; }

Property Value

string?

Settings

public ImportSettings Settings { get; }

Property Value

ImportSettings

Source

The path of the asset relative to res://.

public string Source { get; }

Property Value

string

SourcePath

The path of the asset: res:// and .

public string SourcePath { get; }

Property Value

string

Methods

Depend(string)

Says that the import depends on a file without reading it through (a tool read it).

public void Depend(string path)

Parameters

path string

PhysicalPath(string)

The file on disk behind a virtual path, for tools that read files themselves; null when it is not a plain file (a zip, a pack).

public string? PhysicalPath(string path)

Parameters

path string

Returns

string?

ReadFile(string)

Reads a file of the project (or of a mounted package); one under res:// other than the asset becomes a dependency.

public byte[] ReadFile(string path)

Parameters

path string

Returns

byte[]