Sprite Swap and 2D Animation Integration | 2D Animation | 3.0.8
docs.unity3d.com
    Show / Hide Table of Contents

    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:

    • 2D Animation version 2.2.0-preview.1
    • PSDImporter version 1.2.0-preview.1

    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.

    1. 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.

    2. 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.

    3. Unity attaches the Sprite Resolver component to all Sprite GameObjects that belong to a Category.

    4. 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).

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023