docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Method Create

    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/

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