void DisplayWaves(SerializedProperty _property, int _index) { var waveName = _property.FindPropertyRelative("waveName"); var delay = _property.FindPropertyRelative("delay"); var finishType = _property.FindPropertyRelative("finishType"); var waveTime = _property.FindPropertyRelative("waveTime"); var compareType = _property.FindPropertyRelative("compareType"); var compareValue = _property.FindPropertyRelative("compareValue"); var spawners = _property.FindPropertyRelative("spawners"); EditorGUILayout.PropertyField(waveName); EditorGUILayout.PropertyField(delay); EditorGUILayout.PropertyField(finishType); if (finishType.enumValueIndex == 2) { EditorGUILayout.PropertyField(waveTime); } if (finishType.enumValueIndex == 1) { EditorGUILayout.PropertyField(compareType); EditorGUILayout.PropertyField(compareValue); } EditorExtensions.ArrayFieldButtons(spawners, "Spawner", true, false, true, true, DisplaySpawners); EditorGUILayout.LabelField("--------------"); }