21 lines
433 B
Markdown
21 lines
433 B
Markdown
![]() |
#unity/日常积累
|
||
|
|
||
|
效果:
|
||
|
|
||
|
![[Pasted image 20220928113522.png]]
|
||
|
|
||
|
``` cs
|
||
|
private void DrawUILine(Color color, int thickness = 2, int padding = 10)
|
||
|
{
|
||
|
Rect r = EditorGUILayout.GetControlRect(GUILayout.Height(padding + thickness));
|
||
|
r.height = thickness;
|
||
|
r.y += padding / 2;
|
||
|
r.x -= 2;
|
||
|
r.width += 6;
|
||
|
EditorGUI.DrawRect(r, color);
|
||
|
}
|
||
|
```
|
||
|
|
||
|
直接调用就好
|
||
|
|
||
|
![[Pasted image 20220928113552.png]]
|