using UnityEngine;
namespace EditorAttributes
{
///
/// Attribute to display specified fields horizontally
///
public class HorizontalGroupAttribute : PropertyAttribute
{
public float WidthOffset { get; private set; }
public float PropertySpace { get; private set; }
public bool DrawInBox { get; private set; }
public string[] FieldsToGroup { get; private set; }
///
/// Attribute to display specified fields horizontally
///
/// The name of the fields to group
public HorizontalGroupAttribute(params string[] fieldsToGroup)
{
FieldsToGroup = fieldsToGroup;
DrawInBox = false;
}
///
/// Attribute to display specified fields horizontally
///
/// Draw the group in a nice box
/// The name of the fields to group
public HorizontalGroupAttribute(bool drawInBox, params string[] fieldsToGroup)
{
FieldsToGroup = fieldsToGroup;
DrawInBox = drawInBox;
}
///
/// Attribute to display specified fields horizontally
///
/// By how much to offset the width of the properties in pixels
/// How much space in pixels is between the properties
/// Draw the group in a nice box
/// The name of the fields to group
public HorizontalGroupAttribute(float widthOffset = 0f, float propertySpace = 0f, bool drawInBox = false, params string[] fieldsToGroup)
{
FieldsToGroup = fieldsToGroup;
DrawInBox = drawInBox;
WidthOffset = widthOffset;
PropertySpace = propertySpace;
}
}
}