public static void DrawPropertyDrawerLayout(SerializedProperty property, Type type, bool drawLabel = true) { if (property == null) { Debug.LogError(NullPropertyText); return; } if (SOArchitecture_EditorUtility.HasPropertyDrawer(type)) { if (drawLabel) { EditorGUILayout.PropertyField(property); } else { EditorGUILayout.PropertyField(property, GUIContent.none); } } else { PropertyDrawIteratorLayout iter = new PropertyDrawIteratorLayout(property.Copy(), drawLabel); DrawPropertyDrawerInternal(iter); } }
public static float GetHeight(SerializedProperty property, Type type) { if (SOArchitecture_EditorUtility.HasPropertyDrawer(type)) { return(EditorGUI.GetPropertyHeight(property)); } else { property = property.Copy(); int elements = 0; PropertyIterator iter = new PropertyIterator(property); do { ++elements; }while (iter.Next()); iter.End(); float spacing = (elements - 1) * EditorGUIUtility.standardVerticalSpacing; float elementHeights = elements * EditorGUIUtility.singleLineHeight; return(spacing + elementHeights); } }
private void DrawElement(Rect rect, int index, bool isActive, bool isFocused) { rect = SOArchitecture_EditorUtility.GetReorderableListElementFieldRect(rect); SerializedProperty property = CollectionItemsProperty.GetArrayElementAtIndex(index); EditorGUI.BeginDisabledGroup(DISABLE_ELEMENTS); GenericPropertyDrawer.DrawPropertyDrawer(rect, property, Target.Type); EditorGUI.EndDisabledGroup(); }