Class SimpleTextureMapper
A custom TextureMapper implementation that uses a user-supplied callback to retrieve texture data. This mapper allows you to control how texture streams are opened, enabling scenarios such as loading from memory or over the network.
Inherited Members
ScriptableObject.SetDirty()
ScriptableObject.CreateInstance<T>()
Object.GetInstanceID()
Object.GetHashCode()
Object.Instantiate(Object, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion, Transform)
Object.Instantiate(Object)
Object.Instantiate(Object, Transform)
Object.Instantiate<T>(T)
Object.Instantiate<T>(T, Vector3, Quaternion)
Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
Object.Instantiate<T>(T, Transform)
Object.Destroy(Object)
Object.DestroyImmediate(Object)
Object.DontDestroyOnLoad(Object)
Object.DestroyObject(Object)
Object.FindObjectsOfType<T>()
Object.FindObjectOfType<T>()
Object.ToString()
Object.name
Object.hideFlags
Namespace: TriLibCore.Samples
Assembly: Assembly-CSharp.dll
Syntax
public class SimpleTextureMapper : TextureMapper
Methods
Map(TextureLoadingContext)
Overrides the default texture mapping logic to use the user-supplied callback.
Declaration
public override void Map(TextureLoadingContext textureLoadingContext)
Parameters
Type | Name | Description |
---|---|---|
TextureLoadingContext | textureLoadingContext | The context containing information about the texture being loaded. |
Overrides
Remarks
TriLib calls this method for each texture that needs to be loaded, allowing you to retrieve texture data from a custom source.
Setup(Func<ITexture, Stream>)
Configures the callback used for texture loading.
Declaration
public void Setup(Func<ITexture, Stream> streamReceivingCallback)
Parameters
Type | Name | Description |
---|---|---|
Func<ITexture, Stream> | streamReceivingCallback | A required callback that returns a Stream containing texture data. |
Exceptions
Type | Condition |
---|---|
Exception | Thrown if |