2.1 KiB
Setting up for Sprite Swap
The following steps Follow the steps below to create a Sprite Library Asset, and choose which GameObjects refer to the Asset:
-
Select the Sprite Library Asset from the Asset creation menu by going to Asset > Create > 2D > Sprite Library Asset
-
Select the new Sprite Library Asset and open it in the Sprite Library Editor. The editor displays the list of Categories and Labels available in the Asset.
-
Select + at the lower right of the List to add a new Category. Enter a name into Category (the default name is 'New Category'). Each Category in the same Sprite Library Asset must have a unique name.
-
Add new Labels into the Category by either selecting + and then selecting a Sprite from the Object Picker window; or by dragging a Sprite, Texture or PSD Importer supported file type onto an empty space within the Categories tab
-
Create an empty GameObject (menu: Right-click on the Hierarchy window > Create Empty). Select it and then add the Sprite Renderer component.
-
Add the Sprite Library component to the same GameObject. Assign the Sprite Library Asset created in step 3 to Sprite Library Asset.
-
Add the Sprite Resolver component to the same GameObject.
-
Open the Category drop-down menu, and select a Category you created in step 3. The Label drop-down menu will become available and display thumbnails of the Sprites contained in the Category.
-
Select a Sprite in the Sprite Resolver component to replace the current Sprite rendered by the Sprite Renderer component with the one you have selected.