Sprite Swap and 2D Animation Integration
Sprite Swap is integrated with the 2D Animation workflow. You must install the following packages or newer to use Sprite Swap:
To ensure Sprite Swap works correctly with skeletal animation, the animation rig needs to be identical between the interchangeable Sprites. Use the Copy and Paste tools to duplicate the rig from one Sprite to the other Sprite(s) to ensure they can be swapped.
Asset Generation Behaviour
The following is the steps that Unity takes to generate the various Sprite Swap components.
When you import a PSB file with the PSD Importer, Unity generates a Prefab and creates a Sprite Library Asset as a sub-Asset of this Prefab.
Unity then generates a GameObject for each Sprite in the Prefab that does not belong to a Category, or is the first Label in the Category.
Unity attaches the Sprite Resolver component to all Sprite GameObjects that belong to a Category.
Unity then attaches the Sprite Library component to the root GameObject, and the component is set to reference the Sprite Library Asset created in Step 1.
Sprite Swap and Skeletal Animation Limitations
To ensure Sprite Swap works correctly with skeletal animation, the animation skeleton rig needs to be identical between corresponding Sprites that are to be swapped. Use the Copy and Paste feature to copy both the bones and Mesh data from one Sprite(s) to the other corresponding Sprite(s).