Skip to content

Commit 95c02f7

Browse files
committed
Update materials and README.md
1 parent e066404 commit 95c02f7

7 files changed

Lines changed: 35 additions & 8 deletions

File tree

Examples/ButtonBack.mat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,4 @@ Material:
8282
m_Colors:
8383
- _Color: {r: 1, g: 1, b: 1, a: 1}
8484
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
85+
- _WidthHeightRadius: {r: 160, g: 30, b: 8, a: 0}

Examples/ButtonFore.mat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,4 @@ Material:
8282
m_Colors:
8383
- _Color: {r: 1, g: 1, b: 1, a: 1}
8484
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
85+
- _WidthHeightRadius: {r: 159, g: 29, b: 7.39, a: 0}

Examples/IndependentCornersMaterial.mat

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ Material:
5757
m_Offset: {x: 0, y: 0}
5858
m_Floats:
5959
- _BumpScale: 1
60+
- _ColorMask: 15
6061
- _Cutoff: 0.5
6162
- _DetailNormalMapScale: 1
6263
- _DstBlend: 0
@@ -70,8 +71,17 @@ Material:
7071
- _SmoothnessTextureChannel: 0
7172
- _SpecularHighlights: 1
7273
- _SrcBlend: 1
74+
- _Stencil: 0
75+
- _StencilComp: 8
76+
- _StencilOp: 0
77+
- _StencilReadMask: 255
78+
- _StencilWriteMask: 255
7379
- _UVSec: 0
80+
- _UseUIAlphaClip: 0
7481
- _ZWrite: 1
7582
m_Colors:
7683
- _Color: {r: 1, g: 1, b: 1, a: 1}
7784
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
85+
- _halfSize: {r: 50, g: 50, b: 0, a: 0}
86+
- _r: {r: 10, g: 10, b: 10, a: 10}
87+
- _rect2props: {r: 0.0000038146973, g: -0.0000076293945, b: 63.639614, a: 63.639614}

Examples/MaskedMaterial.mat

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Material:
88
m_PrefabInstance: {fileID: 0}
99
m_PrefabAsset: {fileID: 0}
1010
m_Name: MaskedMaterial
11-
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
11+
m_Shader: {fileID: 4800000, guid: 0bd2ec5d73751e34a814274a454bec41, type: 3}
1212
m_ShaderKeywords:
1313
m_LightmapFlags: 4
1414
m_EnableInstancingVariants: 0
@@ -57,6 +57,7 @@ Material:
5757
m_Offset: {x: 0, y: 0}
5858
m_Floats:
5959
- _BumpScale: 1
60+
- _ColorMask: 15
6061
- _Cutoff: 0.5
6162
- _DetailNormalMapScale: 1
6263
- _DstBlend: 0
@@ -70,8 +71,15 @@ Material:
7071
- _SmoothnessTextureChannel: 0
7172
- _SpecularHighlights: 1
7273
- _SrcBlend: 1
74+
- _Stencil: 0
75+
- _StencilComp: 8
76+
- _StencilOp: 0
77+
- _StencilReadMask: 255
78+
- _StencilWriteMask: 255
7379
- _UVSec: 0
80+
- _UseUIAlphaClip: 0
7481
- _ZWrite: 1
7582
m_Colors:
7683
- _Color: {r: 1, g: 1, b: 1, a: 1}
7784
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
85+
- _WidthHeightRadius: {r: 100, g: 100, b: 16, a: 0}

Examples/RoundedCornersTextureMaterial.mat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,4 @@ Material:
8585
m_Colors:
8686
- _Color: {r: 1, g: 1, b: 1, a: 1}
8787
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
88+
- _WidthHeightRadius: {r: 100, g: 100, b: 60, a: 0}

README.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,22 @@ These components and shaders allows you to add rounded corners to UI elements!
1919
Get `.unitypackage` from [releases](https://github.com/Nobinator/Unity-UI-Rounded-Corners/releases)
2020

2121
## How to use
22-
- Create Panel
23-
- Replace `Image` with `Image With Rounded Corners`
24-
- Сreate new material with one of the following shaders
25-
- `UI/RoundedCorners/Color`
26-
- `UI/RoundedCorners/Texture`
27-
- `UI/RoundedCorners/Manual`
28-
- Attach material to `Image With Rounded Corners`
22+
# Same roundness
23+
- Attach `ImageWithRoundedCorners` to gameobject with `Image`
24+
- Сreate new material
25+
- Pick `RoundedCorners` shader
26+
- Attach material to `ImageWithRoundedCorners` and `Image`
27+
- Profit
28+
# Separate roundness
29+
- Attach `ImageWithIndependentRoundedCorners` to gameobject with `Image`
30+
- Сreate new material
31+
- Pick `IndependentRoundedCorners` shader
32+
- Attach material to `ImageWithIndependentRoundedCorners` and `Image`
2933
- Profit
3034

3135
# Features
36+
## Changing roundness separately or all at once
37+
![](gif-05.gif)
3238
## Keeps round while resizing
3339
![](gif-01.gif)
3440
## Better quality than sprites

gif-05.gif

305 KB
Loading

0 commit comments

Comments
 (0)