Sprite Swap Manual Setup | 2D Animation | 4.0.1
docs.unity3d.com
    Show / Hide Table of Contents

    Sprite Swap Manual Setup

    When you import PSB files into the Editor with the PSD Importer, Unity automatically assigns them a Sprite Library Asset. If you want to create more Sprite Library Assets manually, follow the steps below to set up all components of the Sprite Swap feature.

    1. Create the Sprite Library Asset from the Asset creation menu: Asset > Create > Sprite Library Asset.

    2. Select the new Sprite Library Asset and go to its Inspector window.

    3. Select the plus (+) icon at the bottom-right of the Sprite Library Asset to add a new Category. Enter a name for the Category. Category names must be unique.

    4. Next, create a new GameObject and add the Sprite Renderer component to it.

    5. Add the Sprite Library component to the same GameObject, and assign the new Sprite Library Asset set up in step 3 to the Sprite Library Asset box.

    6. Add the Sprite Resolver component to the same GameObject.

    7. Select the Category drop-down menu and select the Category you want to apply to this GameObject. If the Category already contains Sprites, the component displays a Label drop-down menu and thumbnail visual selector. You can select any Sprite in the Category.

    When you select a Sprite in the Sprite Resolver component, Unity automatically replaces the current Sprite in the Sprite Renderer component with the one you have selected.

    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