Class ContentLoader¶
Namespace: Apogee.Content.Import
Assembly: Apogee.Content.dll
Loads models and textures the way a game wants them: the imported artifact when there is one (imported/ is at
mod://id/imported). It does not check that the artifact is current: importing is the step that does.
public sealed class ContentLoader
Inheritance¶
Inherited Members¶
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
Constructors¶
ContentLoader(VirtualFileSystem)¶
Loads models and textures the way a game wants them: the imported artifact when there is one (imported/ is at
mod://id/imported). It does not check that the artifact is current: importing is the step that does.
public ContentLoader(VirtualFileSystem files)
Parameters¶
files VirtualFileSystem
Properties¶
Assets¶
Which file has which UID, over the same files. The host sets its
public AssetDatabase Assets { get; }
Property Value¶
Methods¶
ArtifactDependenciesFor(string)¶
The virtual paths of the files the artifact of the asset at path was made from (a shader's imported modules), or an empty list when it was not imported.
public IReadOnlyList<string> ArtifactDependenciesFor(string path)
Parameters¶
path string
Returns¶
ArtifactPathFor(string)¶
The virtual path of the artifact that replaces the asset at path, or null when it was not imported.
public string? ArtifactPathFor(string path)
Parameters¶
path string
Returns¶
LoadModel(string, ContentOptions?)¶
The model at path. The textures of an imported one are transcoded for the GPU that options describes (BC7, ASTC, or RGBA8).
public ModelData LoadModel(string path, ContentOptions? options = null)
Parameters¶
path string
options ContentOptions?
Returns¶
LoadTexture(string, bool, TextureCaps, SamplerData?, bool)¶
The image at path as a texture. An imported one has the color space and mips it was imported with (srgb and mipmaps are for the source), transcoded for caps.
public TextureData LoadTexture(string path, bool srgb, TextureCaps caps, SamplerData? sampler = null, bool mipmaps = true)
Parameters¶
path string
srgb bool
caps TextureCaps
sampler SamplerData?
mipmaps bool
Returns¶
Refresh()¶
Reads the indexes (and the UIDs) again (after an import).
public void Refresh()
ResolveAssetPath(string)¶
What a script or a document names as a path: a uid:// becomes the file that has it (
public string ResolveAssetPath(string pathOrUid)
Parameters¶
pathOrUid string