TriLib
Search Results for

    Show / Hide Table of Contents

    Class SimpleExternalDataMapper

    A custom ExternalDataMapper implementation that uses user-supplied callbacks to handle external data loading. This is useful when the model references additional files (e.g., textures, external geometry, etc.) and you want fine-grained control over how and where those files are retrieved.

    Inheritance
    object
    Object
    ScriptableObject
    ExternalDataMapper
    SimpleExternalDataMapper
    Inherited Members
    ScriptableObject.SetDirty()
    ScriptableObject.CreateInstance(string)
    ScriptableObject.CreateInstance(Type)
    ScriptableObject.CreateInstance<T>()
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, bool)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, float)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectsOfType<T>(bool)
    Object.FindObjectOfType<T>()
    Object.FindObjectOfType<T>(bool)
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.FindObjectOfType(Type, bool)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: TriLibCore.Samples
    Assembly: Assembly-CSharp.dll
    Syntax
    public class SimpleExternalDataMapper : ExternalDataMapper

    Methods

    Map(AssetLoaderContext, string, out string)

    Overrides the default mapping logic to use the user-supplied callbacks.

    Declaration
    public override Stream Map(AssetLoaderContext assetLoaderContext, string originalFilename, out string finalPath)
    Parameters
    Type Name Description
    AssetLoaderContext assetLoaderContext

    The current TriLib asset loading context containing model-related state.

    string originalFilename

    The original filename (or path) referencing external data.

    string finalPath

    The resolved final path of the file. This may be modified by your custom callback.

    Returns
    Type Description
    Stream

    An open Stream containing the external file data.

    Overrides
    ExternalDataMapper.Map(AssetLoaderContext, string, out string)
    Remarks

    When TriLib needs to load external data (e.g., texture files), it calls this method, allowing you to provide custom behavior such as streaming from memory or from an alternative storage location.

    Setup(Func<string, Stream>, Func<string, string>)

    Configures the callbacks used for external data mapping.

    Declaration
    public void Setup(Func<string, Stream> streamReceivingCallback, Func<string, string> finalPathReceivingCallback)
    Parameters
    Type Name Description
    Func<string, Stream> streamReceivingCallback

    A required callback that returns the Stream used to read the requested file’s content.

    Func<string, string> finalPathReceivingCallback

    An optional callback that modifies or resolves the final file path before loading.

    Exceptions
    Type Condition
    Exception

    Thrown if streamReceivingCallback is null.

    Extension Methods

    IObjectExtensions.TryToDispose<T>(object)
    In this article
    Back to top Generated by DocFX