-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## [9.0.0] - 2022-08-03 ### Added - Added bone weight index validation in SpriteSkin's validate method, to ensure valid data before continuing with deformation. ### Fixed - Fixed a case where moving vertices forcefully in the Skinning editor could cause a quad reset of the mesh. (case DANB-7) - Fixed a case where multi selecting Sprite Skins would cause a null reference exception to be thrown. (case DANB-126) ### Changed - Refactored internal triangulation and tessellation APIs.
- Loading branch information
Unity Technologies
committed
Aug 3, 2022
1 parent
9d5bcbe
commit df690dc
Showing
85 changed files
with
1,974 additions
and
1,380 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Sprite Library Asset in Unity | ||
|
||
The **Sprite Library Asset** is an Unity asset that contains the Sprites that you want to use for [Sprite Swapping](SpriteSwapIntro.md). This page explains what are the [Sprite Library Asset properties](#sprite-library-asset-properties) and how to [create a Sprite Library Asset](#create-a-sprite-library-asset) or a [Sprite Library Asset variant](#convert-a-sprite-library-asset-into-a-variant). | ||
|
||
A Sprite Library Asset groups the Sprites it contains into [Categories](SL-Editor.md#categories), and you can give these Sprites unique names called [Labels](SL-Editor.md#labels) to differentiate them. You can edit the Sprite Library Asset's content in the [Sprite Library Editor window](SL-Editor.md) (refer to its documentation for more details). | ||
|
||
In the [Sprite Swap workflow](SpriteSwapSetup.md), after creating a Sprite Library Asset or several assets, you can select the Sprite Library Asset you want to use with the [Sprite Library](SL-component.md) component, and the [Sprite Resolver](SL-Resolver.md) component will pull information from the asset selected. | ||
|
||
## Create a Sprite Library Asset | ||
|
||
To create a Sprite Library Asset, go to **Assets** > **Create** > **2D** > **Sprite Library Asset**. | ||
|
||
![](images/2D-animation-SLAsset-dropdown.png) | ||
|
||
## Sprite Library Asset properties | ||
Select the Sprite Library Asset and go to its Inspector window to view the following properties. | ||
|
||
![](images/2D-animation-SLAsset-properties.png) | ||
|
||
Property |Description | ||
--|-- | ||
**Open in Sprite Library Editor** | Select this to open the [Sprite Library Editor window](SL-Editor.md) to edit the content of this asset. | ||
**Main Library** | Leave this property empty to have this Sprite Library Asset refer to its own Categories and Labels. Assign a different Sprite Library Asset to have it become the [Main Library](SL-Editor-UI.md#main-library) of the selected Sprite Library Asset, which will now refer to the second asset's Categories and Labels instead. Doing so also [converts](#convert-a-sprite-library-asset-into-a-variant) the selected Sprite Library Asset into a Variant asset of the Sprite Library Asset set as the **Main Library**. | ||
**Revert** | Select this to reset property changes back to the last saved state. Selecting this removes all unsaved changes. | ||
**Apply** | Select this to save the current property settings. | ||
|
||
## Create a Sprite Library Asset Variant | ||
|
||
A Sprite Library Asset Variant inherits **Categories** and **Labels** from a selected Sprite Library Asset, instead of referring to its own. There are two ways to create a Variant. | ||
|
||
### Create through the menu | ||
|
||
After creating a Sprite Library Asset, select it in the Project window, then go to **Assets** > **Create** > **2D** > **Sprite Library Asset Variant** to create a Variant asset that references it. | ||
|
||
![](images/2D-animation-SLAssetVariant-dropdown.png) | ||
|
||
### Convert a Sprite Library Asset into a Variant | ||
|
||
You can convert an existing Sprite Library Asset into a Variant of another by setting another Sprite Library Asset as its [Main Library](SL-Main-Library.md). | ||
|
||
## Additional resources | ||
- [Sprite Library Editor](SL-Editor.md) | ||
- [Setting up for Sprite Swap](SpriteSwapSetup.md) | ||
- [Overrides to the Main Library](SL-Main-Library.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# Drag sprites to create or edit Categories and Labels | ||
|
||
This page shows the different ways you can create or edit Categories and Labels in a Sprite Library Asset by dragging sprites directly into the Sprite Library Editor window. | ||
|
||
You can automatically create new Categories and Labels by dragging sprites or [PSD Importer supported file types](https://docs.unity3d.com/Packages/com.unity.2d.psdimporter@latest) directly into the [Sprite Library Editor](SL-Editor.md) window. | ||
|
||
## Prerequisites | ||
|
||
- [PSD Importer package](https://docs.unity3d.com/Packages/com.unity.2d.psdimporter@latest) is required for the Sprite Library Editor to recognize imported .psb files. | ||
|
||
## Create a new Category | ||
|
||
1. In the open Sprite Library Editor window, drag a sprite directly onto the Categories column to create a new Category. You can't create Labels without selecting an existing Category first. | ||
|
||
![](images/sl-editor-drag-sprite-category.png) | ||
|
||
## Create a new Label for each sprite | ||
|
||
1. Select a Category, then drag a or a selection of sprites into an empty space in the Labels column. | ||
|
||
![](images/2D-animation-SLAsset-drag-n-drop-04.png)<br/>_Dragging the `head` sprite into the Labels column creates a new Label named `head` in the selected Category._ | ||
|
||
2. Unity creates a new Label for each sprite in the selection and gives it the same name as the sprite it references. **Note:** If an existing Label with the same name already exists at the destination, then the editor appends `_X` to the new Label's name, where `X` is the next number in sequence, starting from zero. | ||
|
||
![](images/2D-animation-SLAsset-drag-n-drop-04-finished.png)<br/>_Dragging in a selection of sprites all named `head` results in additional Labels created with the `_X` suffix for each sprite._ | ||
|
||
## Replace a Label's sprite reference | ||
|
||
1. Drag a sprite onto an existing Label. | ||
![](images/2D-animation-SLAsset-drag-n-drop-05.png) | ||
|
||
2. The editor replaces the sprite reference to the new sprite. The Label's name remains unchanged. | ||
![](images/2D-animation-SLAsset-drag-n-drop-05-finished.png) | ||
|
||
## Create a single Category with multiple Labels | ||
|
||
1. Select multiple sprites from the Project window. | ||
|
||
![](images/sl-editor-drag-select-sprites.png) | ||
2. Drag the selected sprites into the Categories column to create a new Category. The Category is automatically named after the first sprite in the selection. | ||
|
||
![](images/sl-editor-drag-select-sprites-drop.png) | ||
|
||
**Note:** If an existing Category with the same name already exists at the destination, then the editor appends `_X` to the new Category's name, where `X` is the next number in sequence, starting from zero. | ||
|
||
## Create Categories for each Layer and Layer Group | ||
|
||
After you [prepare the .psb](PreparingArtwork.md) of your character, import it into Unity with the PSD Importer package. **Note:** The following [requires](#prerequisites) the PSD Importer package to be installed. | ||
|
||
1. Enable **Use Layer Group** in the imported .psb's properties. | ||
|
||
![](images/sl-editor-drag-wolf-layer-groups.png) | ||
|
||
2. Drag the imported .psb file into the Sprite Library Editor's Categories column. | ||
|
||
3. The editor creates a Category for each Layer and Layer Group, and creates Labels for each sprite. Sprites which belonged to the same Layer Group are automatically grouped into the same Category. | ||
|
||
![](images/sl-editor-drag-wolf-labels.png) | ||
|
||
|
||
## Replace each Labels' sprite references | ||
|
||
The following steps how to replace each Label's sprite reference with sprites from a different imported .psb. **Note:** This method only works if the imported .psb has Layers and Layer Groups with the same exact names as the original .psb used to [create the Categories and Labels](#create-categories-for-each-layer-and-layer-group). | ||
|
||
This method is useful when you have multiple characters with the same Layers and Layer Groups and want to replace their respective sprites without creating a new Sprite Library Asset. | ||
|
||
1. Enable **Use Layer Groups** in the replacement .psb file's properties. | ||
|
||
![](images/sl-editor-drag-knight-drag.png) | ||
|
||
2. Drag the replacement .psb onto an empty space in the Categories column and release. All sprite references of the same name and in the same Categories are automatically replaced with their respective counterparts from the replacement .psb. | ||
|
||
![](images/sl-editor-drag-knight-drop.png) | ||
|
||
## Additional resources | ||
- [PSD Importer package](https://docs.unity3d.com/Packages/com.unity.2d.psdimporter@latest) | ||
- [Preparing and importing artwork](PreparingArtwork.md) |
Oops, something went wrong.