Shaper2D is an editor extension for Unity3D that will allow you to create a number of different shapes you may need in your project and modify them in inspector or through your code. Simply add Shaper 2D to your scene and use the sliders in inspector panel to change the mesh to desired shape: circle, star, polygon, sector or an arc.
This trailer showcases all shapes that can be created with this extension:
- Quickly create circles, sectors, arcs, stars, hexagons, squares, triangles of any size and color.
- Works both on scene and in UI.
- Set inner and outer colors to quickly create circular gradients.
- Modify shape settings through code to create animations.
- Created for mobile. Uses default sprite material. All Shaper 2D objects will issue only one DrawCall. Or zero if there are already sprites in the scene. No additional materials used.
- Generates a 2D collider if needed and updates it on the fly when you change the shape settings from inspector or from code.
- There's an option to export generated mesh as a prefab if you need just need the mesh.
How to use
To start using it, just click Game Object > 2D Object > Shaper 2D in Unity's main menu. Or do the same by right-clicking the Hierarchy panel. This will add a new Shaper 2D object to your scene. If you select this object, in inspector you'll see the panel where you can control the appearence of it (on the right). The extension works by generating a 2D mesh. By setting Sector count you can control the level of detail for this mesh, adding or removing angles to the mesh. Sorting layer and Order in layer properties work exactly as they would for sprites.
Every pproperty can be modified at runtime with a script. There is a demo scene included with this asset that shows how to animate properties with coroutines in C#.
These dynamic meshes use Unity's default sprite material which basically makes them behave in the same was as sprites. This also optimizes the rendering and renders all Shaper 2D objects in a single draw call.