public static float GetObjectReferenceHeight(SerializedProperty property, GUIContent label) { if (property != null && property.propertyType == SerializedPropertyType.ObjectReference) { var headerHeight = EditorGUI.GetPropertyHeight(property, label, false) - EditorGUIUtility.singleLineHeight; return(GetObjectReferenceHeight(property.objectReferenceValue, EasyGUI.CreateCachedEditorWithContext <ReorderableListDrawer>(property.objectReferenceValue, property.serializedObject.targetObject)) + headerHeight); } return(EditorGUI.GetPropertyHeight(property, label, false)); }
public static bool TryDrawObjectReference(Rect position, SerializedProperty property, GUIContent label) { if (property != null && property.propertyType == SerializedPropertyType.ObjectReference) { position.height = EditorGUI.GetPropertyHeight(property, label, false); if (TryDrawObjectReference(position, property.objectReferenceValue, EasyGUI.CreateCachedEditorWithContext <ReorderableListDrawer>(property.objectReferenceValue, property.serializedObject.targetObject))) { EditorGUI.PropertyField(position, property, label, false); return(true); } } return(false); }