TriLib
Search Results for

    Show / Hide Table of Contents

    Class IOAssetLoader

    Provides functionality for selecting and loading 3D models from file streams (including archives) and applying them to the Unity scene using TriLib’s AssetLoader pipeline. This class manages callbacks for model loading, progress reporting, and error handling, and it can optionally destroy itself after the loading process completes.

    Inheritance
    object
    Object
    Component
    Behaviour
    MonoBehaviour
    IOAssetLoader
    AssetLoaderFilePicker
    Inherited Members
    MonoBehaviour.IsInvoking()
    MonoBehaviour.CancelInvoke()
    MonoBehaviour.Invoke(string, float)
    MonoBehaviour.InvokeRepeating(string, float, float)
    MonoBehaviour.CancelInvoke(string)
    MonoBehaviour.IsInvoking(string)
    MonoBehaviour.StartCoroutine(string)
    MonoBehaviour.StartCoroutine(string, object)
    MonoBehaviour.StartCoroutine(IEnumerator)
    MonoBehaviour.StartCoroutine_Auto(IEnumerator)
    MonoBehaviour.StopCoroutine(IEnumerator)
    MonoBehaviour.StopCoroutine(Coroutine)
    MonoBehaviour.StopCoroutine(string)
    MonoBehaviour.StopAllCoroutines()
    MonoBehaviour.print(object)
    MonoBehaviour.useGUILayout
    MonoBehaviour.runInEditMode
    Behaviour.enabled
    Behaviour.isActiveAndEnabled
    Component.GetComponent(Type)
    Component.GetComponent<T>()
    Component.TryGetComponent(Type, out Component)
    Component.TryGetComponent<T>(out T)
    Component.GetComponent(string)
    Component.GetComponentInChildren(Type, bool)
    Component.GetComponentInChildren(Type)
    Component.GetComponentInChildren<T>(bool)
    Component.GetComponentInChildren<T>()
    Component.GetComponentsInChildren(Type, bool)
    Component.GetComponentsInChildren(Type)
    Component.GetComponentsInChildren<T>(bool)
    Component.GetComponentsInChildren<T>(bool, List<T>)
    Component.GetComponentsInChildren<T>()
    Component.GetComponentsInChildren<T>(List<T>)
    Component.GetComponentInParent(Type, bool)
    Component.GetComponentInParent(Type)
    Component.GetComponentInParent<T>(bool)
    Component.GetComponentInParent<T>()
    Component.GetComponentsInParent(Type, bool)
    Component.GetComponentsInParent(Type)
    Component.GetComponentsInParent<T>(bool)
    Component.GetComponentsInParent<T>(bool, List<T>)
    Component.GetComponentsInParent<T>()
    Component.GetComponents(Type)
    Component.GetComponents(Type, List<Component>)
    Component.GetComponents<T>(List<T>)
    Component.GetComponents<T>()
    Component.CompareTag(string)
    Component.SendMessageUpwards(string, object, SendMessageOptions)
    Component.SendMessageUpwards(string, object)
    Component.SendMessageUpwards(string)
    Component.SendMessageUpwards(string, SendMessageOptions)
    Component.SendMessage(string, object)
    Component.SendMessage(string)
    Component.SendMessage(string, object, SendMessageOptions)
    Component.SendMessage(string, SendMessageOptions)
    Component.BroadcastMessage(string, object, SendMessageOptions)
    Component.BroadcastMessage(string, object)
    Component.BroadcastMessage(string)
    Component.BroadcastMessage(string, SendMessageOptions)
    Component.transform
    Component.gameObject
    Component.tag
    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
    Assembly: Assembly-CSharp.dll
    Syntax
    public class IOAssetLoader : MonoBehaviour

    Fields

    AssetLoaderOptions

    Contains settings that control TriLib’s import behavior, such as material/texture handling, colliders, animation type, etc. If null, default options are generated.

    Declaration
    protected AssetLoaderOptions AssetLoaderOptions
    Field Value
    Type Description
    AssetLoaderOptions

    AutoDestroy

    Indicates whether this loader component should self-destruct (destroy its UnityEngine.GameObject) once model loading completes or fails.

    Declaration
    protected bool AutoDestroy
    Field Value
    Type Description
    bool

    HaltTask

    If true, tasks for model loading are created but not started immediately, allowing the caller to chain or manage them manually.

    Declaration
    protected bool HaltTask
    Field Value
    Type Description
    bool

    OnBeginLoad

    A callback invoked once file loading begins, passing a bool indicating whether valid files are actually being loaded.

    Declaration
    protected Action<bool> OnBeginLoad
    Field Value
    Type Description
    Action<bool>

    OnError

    A callback invoked on the main Unity thread if any error occurs during file selection or loading. Carries an IContextualizedError with error details.

    Declaration
    protected Action<IContextualizedError> OnError
    Field Value
    Type Description
    Action<IContextualizedError>

    OnLoad

    A callback invoked on the main Unity thread after the model’s core data has been loaded (but potentially before all materials and textures have finished).

    Declaration
    protected Action<AssetLoaderContext> OnLoad
    Field Value
    Type Description
    Action<AssetLoaderContext>

    OnMaterialsLoad

    A callback invoked on the main Unity thread after all materials, textures, and other resources have finished loading for the model.

    Declaration
    protected Action<AssetLoaderContext> OnMaterialsLoad
    Field Value
    Type Description
    Action<AssetLoaderContext>

    OnProgress

    A callback triggered whenever the loading progress updates (from 0 to 1). Receives both the AssetLoaderContext and a float progress value.

    Declaration
    protected Action<AssetLoaderContext, float> OnProgress
    Field Value
    Type Description
    Action<AssetLoaderContext, float>

    WrapperGameObject

    An optional parent UnityEngine.GameObject under which the loaded model hierarchy will be placed. If null, the model is created at the scene’s root level.

    Declaration
    protected GameObject WrapperGameObject
    Field Value
    Type Description
    GameObject

    Methods

    DestroyMe()

    Safely destroys the UnityEngine.GameObject hosting this loader component. This is called if AutoDestroy is true or upon certain error conditions.

    Declaration
    protected void DestroyMe()

    GetExtensions()

    Constructs a list of ExtensionFilter objects representing valid 3D model file extensions recognized by TriLib, plus "zip" support. An “All Files” filter is also appended for user convenience.

    Declaration
    protected static ExtensionFilter[] GetExtensions()
    Returns
    Type Description
    ExtensionFilter[]

    An array of ExtensionFilter used by file-picker dialogs to filter selectable files.

    OnItemsWithStreamSelected(IList<ItemWithStream>)

    Called once the user has selected or provided streams to load. If valid streams are present, this method triggers file loading via TriLibCore.IOAssetLoader.HandleFileLoading(). Otherwise, it performs cleanup if AutoDestroy is enabled.

    Declaration
    protected void OnItemsWithStreamSelected(IList<ItemWithStream> itemsWithStream)
    Parameters
    Type Name Description
    IList<ItemWithStream> itemsWithStream

    A list of file data items (each containing a Stream) for model loading. May be null or empty if the user canceled or no data is available.

    Extension Methods

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