These components and shaders allow you to add rounded corners to UI elements!
https://github.com/kirevdokimov/Unity-UI-Rounded-Corners.git
- Open
%projectname%/Packages/manifest.json
- Add the following to the dependencies section:
"com.nobi.roundedcorners": "https://github.com/kirevdokimov/Unity-UI-Rounded-Corners.git"
- Add
ImageWithRoundedCorners
component to a GameObject with anImage
- Adjust
Radius
property
- Add
ImageWithIndependentRoundedCorners
to a GameObject with anImage
- Adjust
r
Vector4 property. Each vector component represent radius, clockwise, starting with top-left corner
If you need to add or change the image at runtime, call Validate()
and then Refresh()
to update the materials.