private static void ShowItems(SerializedProperty item, LevelDistanceEditor editor, bool indent) { if (item.isArray) { if (indent) { EditorGUI.indentLevel += 1; } if (item.isExpanded) { if (item.name == "groupLevelDistances") { editor.RecalculateLevelDistances(); //EditorGUILayout.PropertyField(item.FindPropertyRelative("Array.size")); for (int i = 0; i < item.arraySize; i++) { EditorGUILayout.PropertyField(item.GetArrayElementAtIndex(i), GUIContent.none); } } else { for (int i = 0; i < item.arraySize; i++) { EditorGUILayout.PropertyField(item.GetArrayElementAtIndex(i)); } } } if (indent) { EditorGUI.indentLevel -= 1; } } }
public static void Show(SerializedProperty item, LevelDistanceEditor editor, bool indent, bool foldout, string label, ref bool visibility) { if (foldout == true) { visibility = EditorGUILayout.Foldout(visibility, label); if (visibility) { ShowItems(item, editor, indent); } } else { EditorGUILayout.PropertyField(item); ShowItems(item, editor, indent); } }
public static void Show(SerializedProperty item, LevelDistanceEditor editor) { EditorGUILayout.PropertyField(item); if (item.isArray) { EditorGUI.indentLevel += 1; if (item.isExpanded) { if (item.name == "groupLevelDistances") { editor.RecalculateLevelDistances(); } for (int i = 0; i < item.arraySize; i++) { EditorGUILayout.PropertyField(item.GetArrayElementAtIndex(i)); } } EditorGUI.indentLevel -= 1; } }