All you need to really do is use the "isExpanded" field on the SerializedProperty:
http://docs.unity3d.com/ScriptReference/SerializedProperty-isExpanded.html
for example as such:
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) {
property.isExpanded = EditorGUI.Foldout(currentRect, property.isExpanded, "Sound");
if (property.isExpanded) {
...
}
}
↧