EditorGUILayout.BeginHorizontal();
if (GUILayout.Toggle(panelIndex == 0, "1", "ButtonLeft")) panelIndex = 0;
if (GUILayout.Toggle(panelIndex == 1, "2", "ButtonMid")) panelIndex = 1;
if (GUILayout.Toggle(panelIndex == 2, "3", "ButtonMid")) panelIndex = 2;
if (GUILayout.Toggle(panelIndex == 3, "4", "ButtonMid")) panelIndex = 3;
if (GUILayout.Toggle(panelIndex == 4, "5", "ButtonRight")) panelIndex = 4;
EditorGUILayout.EndHorizontal();
bool DrawTab(int index, int cur, string label, string style)
{
bool f = index == cur;
if (GUILayout.Toggle(f, label, style))
{
if (!f)
return true;
}
return false;
}
ButtonLeft:左侧有弧度
ButtonRight:右侧有弧度
ButtonMid:无弧度