public override void BeginDrawHeader(BaseMightyMember mightyMember, BaseElementDecoratorAttribute attribute) { if (PositionByMember(mightyMember, attribute).Contains(DecoratorPosition.BeforeHeader)) { DrawSpace(); } }
public override void EndDraw(BaseMightyMember mightyMember, BaseElementDecoratorAttribute baseAttribute, Action <BaseMightyMember, SerializedProperty, BaseDrawerAttribute> propertyDrawCallback, BaseDrawerAttribute drawerAttribute = null) { var property = mightyMember.Property; if (!property.isArray) { EndDraw(mightyMember, baseAttribute); return; } if (!property.isExpanded) { return; } EditorDrawUtility.DrawArrayBody(property, index => { BeginDrawElement(mightyMember, index, baseAttribute); propertyDrawCallback?.Invoke(mightyMember, property.GetArrayElementAtIndex(index), drawerAttribute); EndDrawElement(mightyMember, index, baseAttribute); }); EditorGUI.indentLevel--; EndDrawArray(mightyMember, baseAttribute); }
public override void EndDrawHeader(BaseMightyMember mightyMember, BaseElementDecoratorAttribute attribute) { if (PositionByMember(mightyMember, attribute).Contains(DecoratorPosition.AfterHeader)) { DrawSpace(((LayoutSpaceAttribute)attribute).Size); } }
public override void BeginDrawArray(BaseMightyMember mightyMember, BaseElementDecoratorAttribute attribute) { if (PositionByMember(mightyMember, attribute).Contains(DecoratorPosition.Before)) { DrawSpace(((LayoutSpaceAttribute)attribute).Size); } }
public override void EndDrawArray(BaseMightyMember mightyMember, BaseElementDecoratorAttribute attribute) { if (PositionByMember(mightyMember, attribute).Contains(DecoratorPosition.After)) { DrawSpace(); } }
public override void BeginDraw(BaseMightyMember mightyMember, BaseElementDecoratorAttribute baseAttribute, Action <BaseMightyMember, SerializedProperty, BaseDrawerAttribute> propertyDrawCallback, BaseDrawerAttribute drawerAttribute = null) { var property = mightyMember.Property; if (!property.isArray) { BeginDraw(mightyMember, baseAttribute); propertyDrawCallback?.Invoke(mightyMember, property, drawerAttribute); return; } BeginDrawArray(mightyMember, baseAttribute); BeginDrawHeader(mightyMember, baseAttribute); if (!EditorDrawUtility.DrawFoldout(property)) { EndDrawHeader(mightyMember, baseAttribute); EndDrawArray(mightyMember, baseAttribute); return; } EditorGUI.indentLevel++; EditorDrawUtility.DrawArraySizeField(property); EndDrawHeader(mightyMember, baseAttribute); }
public DecoratorPosition PositionByMember(BaseMightyMember mightyMember, BaseElementDecoratorAttribute attribute) { if (!m_flexibleSpaceCache.Contains(mightyMember)) { InitDrawer(mightyMember, attribute); } return(m_flexibleSpaceCache[mightyMember].Value); }
public override void EndDraw(BaseMightyMember mightyMember, BaseElementDecoratorAttribute baseAttribute, Action <BaseMightyMember, SerializedProperty, BaseDrawerAttribute> propertyDrawCallback, BaseDrawerAttribute drawerAttribute = null) { if (!mightyMember.Property.isArray && baseAttribute is EndHorizontalAttribute || baseAttribute is HorizontalAttribute) { GUILayout.EndHorizontal(); } }
public override Rect EndDrawHeader(Rect rect, BaseMightyMember mightyMember, BaseElementDecoratorAttribute attribute) { if (PositionByMember(mightyMember, attribute).Contains(DecoratorPosition.AfterHeader)) { rect = DrawSpace(rect, ((LayoutSpaceAttribute)attribute).Size); } return(rect); }
public override void BeginDraw(BaseMightyMember mightyMember, BaseElementDecoratorAttribute baseAttribute, Action <BaseMightyMember, SerializedProperty, BaseDrawerAttribute> propertyDrawCallback, BaseDrawerAttribute drawerAttribute = null) { var property = mightyMember.Property; if (!property.isArray || property.propertyType == SerializedPropertyType.String) { if (baseAttribute is BeginHorizontalAttribute || baseAttribute is HorizontalAttribute) { GUILayout.BeginHorizontal(); } propertyDrawCallback?.Invoke(mightyMember, property, drawerAttribute); return; } if (!EditorDrawUtility.DrawFoldout(property)) { EndDrawHeader(mightyMember, baseAttribute); EndDrawArray(mightyMember, baseAttribute); return; } EditorGUI.indentLevel++; EditorDrawUtility.DrawArraySizeField(property); EditorDrawUtility.DrawArrayBody(property, index => { BeginDrawElement(mightyMember, index, baseAttribute); propertyDrawCallback?.Invoke(mightyMember, property.GetArrayElementAtIndex(index), drawerAttribute); EndDrawElement(mightyMember, index, baseAttribute); }); EditorGUI.indentLevel--; }
public abstract void BeginDrawArray(BaseMightyMember mightyMember, BaseElementDecoratorAttribute attribute);
public override Rect BeginDrawHeader(Rect rect, BaseMightyMember mightyMember, BaseElementDecoratorAttribute attribute) { var position = PositionByMember(mightyMember, attribute); if (position.Contains(DecoratorPosition.BeforeHeader)) { rect = DrawSpace(rect, ((LayoutSpaceAttribute)attribute).Size); } return(rect); }
public abstract void BeginDraw(BaseMightyMember mightyMember, BaseElementDecoratorAttribute baseAttribute, Action <BaseMightyMember, SerializedProperty, BaseDrawerAttribute> propertyDrawCallback, BaseDrawerAttribute drawerAttribute = null);
public abstract float GetElementHeight(BaseMightyMember mightyMember, int index, BaseElementDecoratorAttribute attribute);
public abstract Rect EndDrawElement(Rect rect, BaseMightyMember mightyMember, int index, BaseElementDecoratorAttribute attribute);
public abstract void EndDrawElement(BaseMightyMember mightyMember, int index, BaseElementDecoratorAttribute attribute);
public override float GetElementHeight(BaseMightyMember mightyMember, int index, BaseElementDecoratorAttribute attribute) => 0;
public override Rect BeginDrawElement(Rect rect, BaseMightyMember mightyMember, int index, BaseElementDecoratorAttribute attribute) { var position = PositionByMember(mightyMember, attribute); var size = ((LayoutSpaceAttribute)attribute).Size; if (position.Contains(DecoratorPosition.BeforeElements)) { rect = DrawSpace(rect, size); } if (index != 0 && position.Contains(DecoratorPosition.BetweenElements)) { rect = DrawSpace(rect, size); } return(rect); }
public override void BeginDrawElement(BaseMightyMember mightyMember, int index, BaseElementDecoratorAttribute attribute) { if (attribute is BeginHorizontalAttribute || attribute is HorizontalAttribute) { GUILayout.BeginHorizontal(); } }
public override Rect EndDrawHeader(Rect rect, BaseMightyMember mightyMember, BaseElementDecoratorAttribute attribute) => rect;
public override void EndDrawHeader(BaseMightyMember mightyMember, BaseElementDecoratorAttribute attribute) { }
public override void BeginDrawArray(BaseMightyMember mightyMember, BaseElementDecoratorAttribute attribute) { }
public override void EndDrawElement(BaseMightyMember mightyMember, int index, BaseElementDecoratorAttribute attribute) { var position = PositionByMember(mightyMember, attribute); if (position.Contains(DecoratorPosition.AfterElements)) { DrawSpace(((LayoutSpaceAttribute)attribute).Size); } }
public override Rect BeginDrawElement(Rect rect, BaseMightyMember mightyMember, int index, BaseElementDecoratorAttribute attribute) { if (attribute is BeginVerticalAttribute || attribute is VerticalAttribute) { GUILayout.BeginVertical(); } return(rect); }
public override float GetElementHeight(BaseMightyMember mightyMember, int index, BaseElementDecoratorAttribute attribute) => ((LayoutSpaceAttribute)attribute).Size;
public override Rect EndDrawElement(Rect rect, BaseMightyMember mightyMember, int index, BaseElementDecoratorAttribute attribute) { if (attribute is EndHorizontalAttribute || attribute is HorizontalAttribute) { GUILayout.EndHorizontal(); } return(rect); }
public abstract void EndDrawHeader(BaseMightyMember mightyMember, BaseElementDecoratorAttribute attribute);
public override void EndDrawElement(BaseMightyMember mightyMember, int index, BaseElementDecoratorAttribute attribute) { if (attribute is EndVerticalAttribute || attribute is VerticalAttribute) { GUILayout.EndVertical(); } }
public abstract Rect EndDrawHeader(Rect rect, BaseMightyMember mightyMember, BaseElementDecoratorAttribute attribute);
public override Rect EndDrawElement(Rect rect, BaseMightyMember mightyMember, int index, BaseElementDecoratorAttribute attribute) => rect;