Sprite Resolver component | 2D Animation | 2.2.1-preview.2
docs.unity3d.com
    Show / Hide Table of Contents

    Sprite Resolver component

    The Sprite Resolver component pulls information from the Sprite Library Asset set in the Sprite Library component on the same GameObject. It automatically applies the selected Sprite to the Sprite Renderer. This allows you to swap the Sprite Renderer’s Sprite to other ones in the Sprite Library Asset during run time.

    The component contains two properties - Category and Label - as well as a visual Variant Selector that displays thumbnails of the Sprites contained in the Sprite Library Asset.

    Inspector view of Sprite Resolver Component, with visual selector.

    Property Function
    Category Select which Category you want to use a Sprite from for this GameObject.
    Label Select the Label of the Sprite you want to use for this GameObject.

    You can select the Sprite by setting to the component to its Category and Label, or select the Sprite directly with the visual Variant Selector. When either of the Sprite Resolver’s properties change, the Sprite Resolver component checks the hierarchy for a Sprite Library component on the same GameObject. Once it finds the Sprite Library component, the Sprite Resolver requests the Sprite with the matching Category and Label values.

    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