コード例 #1
0
        public void Draw(SerializedProperty property, Slices slices)
        {
            var attribute = property.GetCustomAttribute <HighlightAttribute>();

            if (attribute == null)
            {
                return;
            }

            var slice = new DrawableImpl(rect => GuiUtil.DrawRect(rect.Extend(1), attribute.Color));

            slices.AddBefore(slice);
        }
コード例 #2
0
ファイル: Drawer.cs プロジェクト: jorik041/one-line
        protected MetaSlice DrawHighlight(SerializedProperty property, Slices slices, int before, int after)
        {
            var attribute = property.GetCustomAttribute <HighlightAttribute>();

            if (attribute == null)
            {
                return(null);
            }

            var slice = new MetaSlice(before, after,
                                      rect => GuiUtil.DrawRect(rect.Extend(1), attribute.Color));

            slices.Add(slice);
            return(slice);
        }
コード例 #3
0
 public void Draw(Rect rect)
 {
     rect.x    += (rect.width - lineWidth) / 2;
     rect.width = lineWidth;
     GuiUtil.DrawRect(rect, GuiUtil.GrayColor);
 }
コード例 #4
0
 private void DrawLine(Rect rect, int thickness)
 {
     rect.y     += (rect.height - thickness) / 2;
     rect.height = thickness;
     GuiUtil.DrawRect(rect, Color);
 }