Class SpriteLibrarySourceAssetFactory
Class used for creating new Sprite Library Source Assets.
Inherited Members
Namespace: UnityEditor.U2D.Animation
Assembly: Unity.2D.Animation.Editor.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/ |