2025-03-26 00:02:56 +08:00

433 B

#unity/日常积累

效果:

!Pasted image 20220928113522.png

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