2.3 KiB
Swapping Sprite Library Assets
If swapping each Sprite individually takes too much effort, you can instead swap the entire Sprite Library Asset to another one containing alternate Sprites.
The following example shows how to switch from a Sprite Library Asset of color Sprites to another one containing identical Sprites but in grayscale:
Left: Prefab with the colored Sprite Library Asset. Right: Prefab with the grayscale Sprite Library Asset.
-
Create variants of your character artwork. In this example, a grayscale variant of the original artwork was created in Photoshop (or any other compatible image editor).
-
Import both .psb files into the Unity Editor. Both become separate Prefabs in the Asset window.
-
Select the color Prefab and open it in the Skinning Editor. Assign each Sprite of the character to a unique Category. It is suggested to name each Category and Label after the respective body part of the character. Apply the changes once you are ready, and exit the Sprite Editor.
-
Select the grayscale Prefab, and give its corresponding Sprites the same Category and Label names as the color Prefab.
Give the same Category and Label names to the grayscale Prefab. -
Drag the color Prefab into the Scene view, and go to the root GameObject. The Sprite Library component is attached to the root GameObject and refers to the default Sprite Library Asset that Unity automatically generated.
-
With the Inspector window the color Prefab remaining open, go to the Asset window and expand the grayscale Prefab. Find the grayscale Prefab Sprite Library Asset and drag it to the color Prefab‘s Sprite Library Asset box, which replaces the color Prefab’s original Sprite Library Asset.
-
The Sprites of the color Prefab should have switched to their grayscale counterparts of the grayscale Sprite Library Asset.