Class FilePickerExternalDataMapper
Provides an external data mapping strategy for file picker–based workflows.
This mapper searches through a collection of file items (each with an associated stream)
to find one whose short filename matches the given originalFilename
.
If a match is found, the file’s stream is returned, along with its full name as the final path.
Inherited Members
Namespace: TriLibCore.Mappers
Assembly: Assembly-CSharp.dll
Syntax
public class FilePickerExternalDataMapper : ExternalDataMapper
Methods
Map(AssetLoaderContext, string, out string)
Declaration
public override Stream Map(AssetLoaderContext assetLoaderContext, string originalFilename, out string finalPath)
Parameters
Type | Name | Description |
---|---|---|
AssetLoaderContext | assetLoaderContext | The TriLibCore.AssetLoaderContext that contains overall model loading data, including custom context data holding references to selected files. |
string | originalFilename | The original filename from the model data used to locate the corresponding file in the file picker selection. |
string | finalPath | When a matching file is found, this output parameter is set to the file's full name or path. |
Returns
Type | Description |
---|---|
Stream | A Stream for the external data if a matching file is found; otherwise, |
Overrides
Remarks
This method looks for an external data source by comparing the short filename of the
originalFilename
(converted to lower-case) with the short filenames
of the files present in the custom context data (of type IList<T>).
If a match is found and the file has valid data, it returns the open data stream from that file
and sets finalPath
to the full file name.
If no match is found or if the custom context data is missing, a warning is issued and null
is returned.