docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class AssetSourceLocation

    Derive this class to load Unity assets from a specific location

    Inheritance
    object
    AssetSourceLocation
    LocalAssetSourceLocation
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.Perception.Randomization
    Assembly: Unity.Perception.Runtime.dll
    Syntax
    public abstract class AssetSourceLocation

    Properties

    count

    The number of assets available at this location

    Declaration
    public abstract int count { get; }
    Property Value
    Type Description
    int

    Methods

    Initialize<T>(AssetRole<T>)

    Execute setup steps before accessing assets at this location

    Declaration
    public abstract void Initialize<T>(AssetRole<T> assetRole) where T : Object
    Parameters
    Type Name Description
    AssetRole<T> assetRole

    The asset role that will be used to preprocess assets from this location

    Type Parameters
    Name Description
    T

    The type of assets that will be loaded from this location

    LoadAsset<T>(int)

    Retrieves an asset from this location using the provided index

    Declaration
    public abstract T LoadAsset<T>(int index) where T : Object
    Parameters
    Type Name Description
    int index

    The index to load the asset from

    Returns
    Type Description
    T

    The loaded asset

    Type Parameters
    Name Description
    T

    The type of asset to load

    ReleaseAssets()

    Unload all assets loaded from this location

    Declaration
    public abstract void ReleaseAssets()
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)