Class FilePickerTextureMapper
Provides functionality to load textures from a file picker selection. This mapper searches through the list of ItemWithStream objects (provided in the custom context data) to find a file whose short filename matches the filename specified in the TriLib TriLibCore.Interfaces.ITexture. If a match is found, it opens the corresponding data stream.
Inherited Members
Namespace: TriLibCore.Mappers
Assembly: Assembly-CSharp.dll
Syntax
public class FilePickerTextureMapper : TextureMapper
Methods
Map(TextureLoadingContext)
Declaration
public override void Map(TextureLoadingContext textureLoadingContext)
Parameters
Type | Name | Description |
---|---|---|
TextureLoadingContext | textureLoadingContext | The context containing the texture information, including the TriLib TriLibCore.Interfaces.ITexture, associated custom context data, and the output stream. |
Overrides
Remarks
This method first checks if the texture's filename is provided. If it is, the method retrieves a list of ItemWithStream objects from the TriLibCore.AssetLoaderContext.CustomData. It then converts the texture's filename and each candidate file's name to lowercase short filenames and compares them. If a match is found and the candidate file contains valid data, the texture's stream is set to the stream provided by the candidate file. If the custom context data is missing, a warning is logged.