Skip to content

Instantly share code, notes, and snippets.

@Sacristan
Created January 11, 2017 11:54
Show Gist options
  • Save Sacristan/a00e55aa194800604ef8ce4d52f8380c to your computer and use it in GitHub Desktop.
Save Sacristan/a00e55aa194800604ef8ce4d52f8380c to your computer and use it in GitHub Desktop.
This is roughly what DrawDefaultInspector() does:
override def OnInspectorGUI():
serializedObject.Update()
EditorGUIUtility.LookLikeInspector()
myIterator = serializedObject.FindProperty("myArrayField")
while true:
myRect = GUILayoutUtility.GetRect(0f, 16f);
showChildren = EditorGUI.PropertyField(myRect, myIterator)
break unless myIterator.NextVisible(showChildren)
serializedObject.ApplyModifiedProperties()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment