public override void BeginDrawHeader(BaseMightyMember mightyMember, BaseElementDecoratorAttribute attribute)
 {
     if (PositionByMember(mightyMember, attribute).Contains(DecoratorPosition.BeforeHeader))
     {
         DrawSpace();
     }
 }
예제 #2
0
        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);
        }
예제 #3
0
 public override void EndDrawHeader(BaseMightyMember mightyMember, BaseElementDecoratorAttribute attribute)
 {
     if (PositionByMember(mightyMember, attribute).Contains(DecoratorPosition.AfterHeader))
     {
         DrawSpace(((LayoutSpaceAttribute)attribute).Size);
     }
 }
예제 #4
0
 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();
     }
 }
예제 #6
0
        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);
        }
예제 #7
0
 public DecoratorPosition PositionByMember(BaseMightyMember mightyMember, BaseElementDecoratorAttribute attribute)
 {
     if (!m_flexibleSpaceCache.Contains(mightyMember))
     {
         InitDrawer(mightyMember, attribute);
     }
     return(m_flexibleSpaceCache[mightyMember].Value);
 }
예제 #8
0
 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();
     }
 }
예제 #9
0
        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);
        }
예제 #10
0
        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--;
        }
예제 #11
0
 public abstract void BeginDrawArray(BaseMightyMember mightyMember, BaseElementDecoratorAttribute attribute);
예제 #12
0
        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);
        }
예제 #13
0
 public abstract void BeginDraw(BaseMightyMember mightyMember, BaseElementDecoratorAttribute baseAttribute,
                                Action <BaseMightyMember, SerializedProperty, BaseDrawerAttribute> propertyDrawCallback, BaseDrawerAttribute drawerAttribute = null);
예제 #14
0
 public abstract float GetElementHeight(BaseMightyMember mightyMember, int index, BaseElementDecoratorAttribute attribute);
예제 #15
0
 public abstract Rect EndDrawElement(Rect rect, BaseMightyMember mightyMember, int index, BaseElementDecoratorAttribute attribute);
예제 #16
0
 public abstract void EndDrawElement(BaseMightyMember mightyMember, int index, BaseElementDecoratorAttribute attribute);
예제 #17
0
 public override float GetElementHeight(BaseMightyMember mightyMember, int index, BaseElementDecoratorAttribute attribute) => 0;
예제 #18
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);
        }
예제 #19
0
 public override void BeginDrawElement(BaseMightyMember mightyMember, int index, BaseElementDecoratorAttribute attribute)
 {
     if (attribute is BeginHorizontalAttribute || attribute is HorizontalAttribute)
     {
         GUILayout.BeginHorizontal();
     }
 }
예제 #20
0
 public override Rect EndDrawHeader(Rect rect, BaseMightyMember mightyMember, BaseElementDecoratorAttribute attribute) => rect;
예제 #21
0
 public override void EndDrawHeader(BaseMightyMember mightyMember, BaseElementDecoratorAttribute attribute)
 {
 }
예제 #22
0
 public override void BeginDrawArray(BaseMightyMember mightyMember, BaseElementDecoratorAttribute attribute)
 {
 }
예제 #23
0
        public override void EndDrawElement(BaseMightyMember mightyMember, int index, BaseElementDecoratorAttribute attribute)
        {
            var position = PositionByMember(mightyMember, attribute);

            if (position.Contains(DecoratorPosition.AfterElements))
            {
                DrawSpace(((LayoutSpaceAttribute)attribute).Size);
            }
        }
예제 #24
0
 public override Rect BeginDrawElement(Rect rect, BaseMightyMember mightyMember, int index, BaseElementDecoratorAttribute attribute)
 {
     if (attribute is BeginVerticalAttribute || attribute is VerticalAttribute)
     {
         GUILayout.BeginVertical();
     }
     return(rect);
 }
예제 #25
0
 public override float GetElementHeight(BaseMightyMember mightyMember, int index, BaseElementDecoratorAttribute attribute) =>
 ((LayoutSpaceAttribute)attribute).Size;
예제 #26
0
 public override Rect EndDrawElement(Rect rect, BaseMightyMember mightyMember, int index, BaseElementDecoratorAttribute attribute)
 {
     if (attribute is EndHorizontalAttribute || attribute is HorizontalAttribute)
     {
         GUILayout.EndHorizontal();
     }
     return(rect);
 }
예제 #27
0
 public abstract void EndDrawHeader(BaseMightyMember mightyMember, BaseElementDecoratorAttribute attribute);
예제 #28
0
 public override void EndDrawElement(BaseMightyMember mightyMember, int index, BaseElementDecoratorAttribute attribute)
 {
     if (attribute is EndVerticalAttribute || attribute is VerticalAttribute)
     {
         GUILayout.EndVertical();
     }
 }
예제 #29
0
 public abstract Rect EndDrawHeader(Rect rect, BaseMightyMember mightyMember, BaseElementDecoratorAttribute attribute);
 public override Rect EndDrawElement(Rect rect, BaseMightyMember mightyMember, int index, BaseElementDecoratorAttribute attribute)
 => rect;