Using the Sprite Editor Package in Unity 2021
The Sprite Editor package allows us to take a single image file with multiple images in it, slice that file up, and generate individual sprite files that Unity can distinguish from each other.
This is the original sprite sheet / image file.
Note that the file, “SciFiGUI” does not have any children objects/files at this time.
That is because the import settings for Texture Type are defaulted to “default” which is not considered a sprite sheet.
I will need to adjust the import to distinguish this file as a sprite sheet.
With the sprite sheet file selected in the Project window, I’ve changed the import settings in the Inspector window to reflect that this file contains multiple sprites.
However, to ensure the correct slicing positions of the images, I need to open the Sprite Editor which is not available by default in the Unity Editor.
We can fix this by installing the “2D Sprite” package from the Package Manager.
Now that I have the Sprite Editor available, I’ve attempted to find the correct slicing settings.
However, this image does not have the objects positioned in a manner where I could enter the number of columns and rows for a correct result.
I next attempted to use the Smart slicing feature, which was too hit and miss.
By clicking the Revert button I can restore the file to its prior state.
The Safe slicing method did not generate the correct results either.
Luckily, I can do this manually by holding the left mouse button and dragging out a rectangle around each sprite as shown above.
Above is what the slice outlines look like once I’ve finished.
At this point, clicking the “Apply” button will slice the image into individual sprites I can use in Unity.
After hitting “Apply”, I can close the Sprite Editor and click the original sprite sheet file in the Project window.
It now has a childed sprite generated according to my slicing outlines.
That’s it, enjoy!