Awesome
Unity-SpriteAssist
ℹ️About
Unity-SpriteAssist is an Unity extension that assist Sprite's mesh creation more conveniently.
🖥️System Requirements
Unity 2021.3 LTS or later versions
📝Features
- Control Vertex Easily with a Sliderbar.
- Make a transparent, opaque, complex(transparent + opaque) mesh
- Convert Sprite to MeshRenderer Prefab
📷Screenshots
<p> <img src="https://user-images.githubusercontent.com/9159336/213104399-26e02766-dd83-467c-a486-37b17b4a5081.png" width="250"> <img src="https://user-images.githubusercontent.com/9159336/213102784-29a08fcf-7a0f-46b3-a1b5-f3d2f3be3422.png" width="250"> <img src="https://user-images.githubusercontent.com/9159336/213102924-89149b98-49de-488b-9437-9a7bf9a2da48.png" width="250"> <img src="https://user-images.githubusercontent.com/9159336/213102642-ce282867-8a45-47d9-a426-dbc32a733483.png" width="250"> <img src="https://user-images.githubusercontent.com/9159336/213103066-fbfbf2fe-56b5-4f08-b0c3-f30d19b93fa1.png" width="250"> <img src="https://user-images.githubusercontent.com/9159336/213104230-d421c911-4441-4b3a-a2a2-928884cc753e.png" width="250"> </p>
📦Installation
Unity Package Manager
You can add https://github.com/sr4dev/Unity-SpriteAssist.git?path=Assets/SpriteAssist
to Package Manager.
OpenUPM
https://openupm.com/packages/com.sr4dev.unity-spriteassist/
openupm add com.sr4dev.unity-spriteassist
Manual installation
Clone or download this repository and copy Assets/SpriteAssist
folder to your Unity project.
✏️How to use
- Select a Sprite asset in the Project window.
- Select a Mode and adjust parameters.
Mode
- Transparent Mesh: Default Mode. Allow alpha pixel.
- Opaque Mesh: Disallow alpha pixel. You can use the mesh for opaque shader.
- Complex: Separate area by alpha.
- Alpha pixel is converted to Transparent Mesh area.
- Non-alpha pixel is converted to Opaque Mesh area.
- To Use Complex mode must be created Mesh Prefab.
- Complex mode dose not override original Sprite mesh.
Parameter
- Detail: Density and accuracy of the mesh to the Sprite outline.
- Alpha Tolerance: Threshold for transparency considered when generating the outline.
- Detect Holes: Detect holes from outline.
- Edge Smoothing: Smoothing sharp edges.
- Non-zero Winding: Use Non-zero winding rule. Default Winding rule is even-odd.
Even-odd(left), Non-zero(right)
Wikipedia: Non-zero winding
Mesh Prefab
- Prefab: Linked Prefab with Sprite.
- Create/Remove: Create or remove a Prefab.
- Default Transparent Shader
- Default Opaque Shader
⚠️Caution!
AssetImporter.userData
This extension uses AssetImporter.userData of Texture asset. If your project already uses userData, it will be overridden.
Unity Document: AssetImporter.userData
Known Issues
- Does not support PSD file.
- Import time may be significantly longer or may not complete in Unity 6.
For other issues, please refer to the link. https://github.com/sr4dev/Unity-SpriteAssist/issues
🗺️Roadmap
- Support pre-packed Sprite.
- Support Sprite Mode: Multiple.
- Add Sprite Animation example.
- Add tutorial(pdf, movies...).
- Release to the Asset Store.
🔣License
MIT License
📚Library
- Triangulation: LibTessDotNet v1.1.13
- Polygon Clipping: Clipper v6.4.2
☕Donation
<a href='https://ko-fi.com/sr4dev' target='_blank'><img height='35' style='border:0px;height:46px;' src='https://az743702.vo.msecnd.net/cdn/kofi3.png?v=0' border='0' alt='Buy Me a Coffee at ko-fi.com' />