docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class SpriteLibraryAsset

    A custom Asset that stores Sprites grouping

    Inheritance
    object
    Object
    ScriptableObject
    SpriteLibraryAsset
    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: UnityEngine.U2D.Animation
    Assembly: Unity.2D.Animation.Runtime.dll
    Syntax
    [HelpURL("https://docs.unity3d.com/Packages/com.unity.2d.animation@7.0/manual/SLAsset.html")]
    [MovedFrom("UnityEngine.Experimental.U2D.Animation")]
    public class SpriteLibraryAsset : ScriptableObject

    Methods

    AddCategoryLabel(Sprite, string, string)

    Add or replace and existing Sprite into the given Category and Label

    Declaration
    public void AddCategoryLabel(Sprite sprite, string category, string label)
    Parameters
    Type Name Description
    Sprite sprite

    Sprite to add

    string category

    Category to add the Sprite to

    string label

    Label of the Category to add the Sprite to. If this parameter is null or an empty string, it will attempt to add a empty category

    GetCategoryLabelNames(string)

    Returns the labels' name for the given name

    Declaration
    public IEnumerable<string> GetCategoryLabelNames(string category)
    Parameters
    Type Name Description
    string category

    Category name

    Returns
    Type Description
    IEnumerable<string>

    A Enumerable string representing labels' name

    GetCategoryNames()

    Return all the Category names of the Sprite Library Asset that is associated.

    Declaration
    public IEnumerable<string> GetCategoryNames()
    Returns
    Type Description
    IEnumerable<string>

    A Enumerable string value representing the name

    GetCategorylabelNames(string)

    (Obsolete) Returns the labels' name for the given name

    Declaration
    [Obsolete("GetCategorylabelNames has been deprecated. Please use GetCategoryLabelNames (UnityUpgradable) -> GetCategoryLabelNames(*)")]
    public IEnumerable<string> GetCategorylabelNames(string category)
    Parameters
    Type Name Description
    string category

    Category name

    Returns
    Type Description
    IEnumerable<string>

    A Enumerable string representing labels' name

    GetSprite(string, string)

    Returns the Sprite registered in the Asset given the Category and Label value

    Declaration
    public Sprite GetSprite(string category, string label)
    Parameters
    Type Name Description
    string category

    Category string value

    string label

    Label string value

    Returns
    Type Description
    Sprite

    RemoveCategoryLabel(string, string, bool)

    Remove a Label from a given Category

    Declaration
    public void RemoveCategoryLabel(string category, string label, bool deleteCategory)
    Parameters
    Type Name Description
    string category

    Category to remove from

    string label

    Label to remove

    bool deleteCategory

    Indicate to remove the Category if it is empty

    In This Article
    Back to top
    Copyright © 2025 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)