protected virtual void BeginDrawMember(MightySerializedField serializedField, T attribute, MightyDrawer.PropertyDrawCallback propertyDrawCallback = null, BasePropertyDrawerAttribute drawerAttribute = null) { var property = serializedField.Property; if (!property.IsCollection()) { BeginDraw(serializedField, attribute); propertyDrawCallback?.Invoke(serializedField, property, drawerAttribute); return; } BeginDrawArray(serializedField, attribute); BeginDrawHeader(serializedField, attribute); if (!MightyGUIUtilities.DrawFoldout(property)) { EndDrawHeader(serializedField, attribute); EndDrawArray(serializedField, attribute); return; } EditorGUI.indentLevel++; MightyGUIUtilities.DrawArraySizeField(property); EndDrawHeader(serializedField, attribute); }
public virtual void EndDrawMember(MightySerializedField serializedField, T attribute, MightyDrawer.PropertyDrawCallback propertyDrawCallback, BasePropertyDrawerAttribute drawerAttribute = null) { var property = serializedField.Property; if (!property.IsCollection()) { EndDraw(serializedField, attribute); return; } if (!property.isExpanded) { return; } MightyGUIUtilities.DrawArrayBody(property, index => { BeginDrawElement(serializedField, index, attribute); propertyDrawCallback?.Invoke(serializedField, property.GetArrayElementAtIndex(index), drawerAttribute); EndDrawElement(serializedField, index, attribute); }); EditorGUI.indentLevel--; EndDrawArray(serializedField, attribute); }
protected override void BeginDrawMember(MightySerializedField serializedField, T attribute, MightyDrawer.PropertyDrawCallback propertyDrawCallback = null, BasePropertyDrawerAttribute drawerAttribute = null) { var property = serializedField.Property; if (property.IsCollection()) { MightyGUIUtilities.DrawArray(property, index => { BeginDrawElement(serializedField, index, attribute); propertyDrawCallback?.Invoke(serializedField, property, drawerAttribute); EndDrawElement(serializedField, index, attribute); }); return; } BeginLayout(serializedField, attribute); propertyDrawCallback?.Invoke(serializedField, property, drawerAttribute); }