How to use Editor Styles?

I'm trying to get the same effect as the small button in the Unity inspector, but to no avail. Here's what I've got:

EditorGUIUtility.LookLikeInspector();
if(GUILayout.Button("+", radioButton) )
{
    // Stuff
}

From reading the documentation it looks like it ought to behave just like a normal style on a GUILayout button, but I keep getting the "Uknown Identifer : 'radioButton' ". Am I using this incorrectly?

1 Answer

1

but I keep getting the "Uknown Identifer : 'radioButton' ". Am I using this incorrectly?

Yes, you haven't defined the variable radioButton. Maybe you meant to search for a style called radioButton?

EditorGUIUtility.LookLikeInspector();
if (GUILayout.Button("+", "radioButton"))
{
    // Stuff
}