rimworld-animation-studio/Library/PackageCache/com.unity.2d.animation@3.2.6/Documentation~/SRComponent.md
2022-09-13 00:36:34 -05:00

1.5 KiB
Raw Blame History

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 Renderers 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 Resolvers 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.