all-iver / shapes2d

Shapes2D for Unity3D - Make simple art assets quickly in Unity
http://sub-c.org/Shapes2D/documentation/
MIT License
157 stars 28 forks source link

Attempt to make SpriteMask on child GameObjects work during PNG render #22

Open all-iver opened 1 year ago

all-iver commented 1 year ago

This is a very quick update to try and get SpriteMask to work during convert to sprite, if it's on a child GameObject. During convert to sprite, shapes are rendered one at a time, and prior to this only the shape currently being rendered was on a layer visible to the camera, so anything else in the hierarchy would not affect the render. This change makes it so the entire hierarchy is on the correct layer, but graphics components are disabled except for the shape being rendered. Barely tested and not tested at all with UI.

Before merging this would need some cleanup to factor with DisableUIGraphics(). Also, if a SpriteMask component is on a child but the child doesn't have a Shape component, it won't affect the png.