docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class SpriteLibrarySourceAssetFactory

    Class used for creating new Sprite Library Source Assets.

    Inheritance
    object
    SpriteLibrarySourceAssetFactory
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: UnityEditor.U2D.Animation
    Assembly: solution.dll
    Syntax
    public static class SpriteLibrarySourceAssetFactory

    Fields

    extension

    Sprite Library Source Asset's extension.

    Declaration
    public const string extension = ".spriteLib"
    Field Value
    Type Description
    string

    Methods

    Create(string, IEnumerable<ISpriteLibraryCategory>, string)

    Creates a new Sprite Library Source Asset at a given path.

    Declaration
    public static string Create(string path, IEnumerable<ISpriteLibraryCategory> categories, string mainLibraryPath = null)
    Parameters
    Type Name Description
    string path

    Save path. Must be within the Assets folder.

    IEnumerable<ISpriteLibraryCategory> categories

    Collection of categories in the library.

    string mainLibraryPath

    A path to the main library. Null if there is no main library.

    Returns
    Type Description
    string

    A relative path to the Project with correct extension.

    Exceptions
    Type Condition
    InvalidOperationException

    Throws when the save path is invalid/

    Create(string, SpriteLibraryAsset, string)

    Creates a new Sprite Library Source Asset at a given path.

    Declaration
    public static string Create(string path, SpriteLibraryAsset spriteLibraryAsset, string mainLibraryPath = null)
    Parameters
    Type Name Description
    string path

    Save path. Must be within the Assets folder.

    SpriteLibraryAsset spriteLibraryAsset

    Sprite Library Asset to be saved.

    string mainLibraryPath

    A path to the main library. Null if there is no main library.

    Returns
    Type Description
    string

    A relative path to the Project with correct extension.

    Exceptions
    Type Condition
    InvalidOperationException

    Throws when the save path is invalid/

    SaveAsSourceAsset(SpriteLibraryAsset, string, string)

    Creates a new Sprite Library Source Asset at a given path.

    Declaration
    public static string SaveAsSourceAsset(this SpriteLibraryAsset spriteLibraryAsset, string path, string mainLibraryPath = null)
    Parameters
    Type Name Description
    SpriteLibraryAsset spriteLibraryAsset

    Sprite Library Asset to be saved.

    string path

    Save path. Must be within the Assets folder.

    string mainLibraryPath

    A path to the main library. Null if there is no main library.

    Returns
    Type Description
    string

    A relative path to the Project with correct extension.

    Exceptions
    Type Condition
    InvalidOperationException

    Throws when the save path is invalid/

    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)