Class SpriteLibraryAsset | 2D Animation | 3.0.8
docs.unity3d.com
    Show / Hide Table of Contents

    Class SpriteLibraryAsset

    A custom Asset that stores Sprites grouping

    Inheritance
    Object
    SpriteLibraryAsset
    Namespace: UnityEngine.Experimental.U2D.Animation
    Syntax
    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

    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

    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

    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, Boolean)

    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

    Boolean deleteCategory

    Indicate to remove the Category if it is empty

    In This Article
    • Methods
      • AddCategoryLabel(Sprite, String, String)
      • GetCategorylabelNames(String)
      • GetCategoryLabelNames(String)
      • GetCategoryNames()
      • GetSprite(String, String)
      • RemoveCategoryLabel(String, String, Boolean)
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023