Add button size parameter

This commit is contained in:
VladV 2022-06-06 19:35:46 +03:00
parent 9d8fab200e
commit a45fde19d4
4 changed files with 25 additions and 1 deletions

View File

@ -33,6 +33,11 @@ namespace TriInspector.Drawers
public override float GetHeight(float width, TriProperty property, TriElement next)
{
if (Attribute.ButtonSize != 0)
{
return Attribute.ButtonSize;
}
return EditorGUIUtility.singleLineHeight;
}

View File

@ -16,6 +16,12 @@ namespace TriInspector
Name = name;
}
public string Name { get; }
public ButtonAttribute(ButtonSizes buttonSize)
{
ButtonSize = (int) buttonSize;
}
public string Name { get; set; }
public int ButtonSize { get; }
}
}

10
Runtime/ButtonSizes.cs Normal file
View File

@ -0,0 +1,10 @@
namespace TriInspector
{
public enum ButtonSizes
{
Small = 0,
Medium = 22,
Large = 32,
Gigantic = 62,
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: a7580fa208fd4eb695fa8b9f9ca0c4d7
timeCreated: 1654532890