Class ZipFileTextureMapper
Provides a texture mapping strategy for extracting texture data from Zip files. This mapper retrieves a Zip file from the custom context data and iterates through its entries, comparing their names to the texture's filename. If a matching file is found, its stream is opened and assigned to the texture loading context.
Inherited Members
Namespace: TriLibCore.Mappers
Assembly: Assembly-CSharp.dll
Syntax
public class ZipFileTextureMapper : TextureMapper
Methods
Map(TextureLoadingContext)
Declaration
public override void Map(TextureLoadingContext textureLoadingContext)
Parameters
Type | Name | Description |
---|---|---|
TextureLoadingContext | textureLoadingContext | The context containing texture information, including the TriLib ITexture, the target texture type, and where the stream is to be assigned. |
Overrides
Remarks
This method begins by retrieving the custom context data as an instance of ZipLoadCustomContextData. It verifies that the Zip file instance is valid.
The method then obtains the filename (without extension) of the current zip entry that was used to load the model and compares it (in lower-case) to the short filename of the texture. It iterates through all file entries in the Zip and, for each valid texture file type, checks if either:
- For diffuse textures, the filename (without extension) matches the model's zip entry filename,
- or the short filenames match directly.