mirror of
https://github.com/codewriter-packages/Tri-Inspector.git
synced 2025-01-22 08:18:49 -05:00
Add button size parameter
This commit is contained in:
parent
9d8fab200e
commit
a45fde19d4
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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
10
Runtime/ButtonSizes.cs
Normal file
@ -0,0 +1,10 @@
|
||||
namespace TriInspector
|
||||
{
|
||||
public enum ButtonSizes
|
||||
{
|
||||
Small = 0,
|
||||
Medium = 22,
|
||||
Large = 32,
|
||||
Gigantic = 62,
|
||||
}
|
||||
}
|
3
Runtime/ButtonSizes.cs.meta
Normal file
3
Runtime/ButtonSizes.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a7580fa208fd4eb695fa8b9f9ca0c4d7
|
||||
timeCreated: 1654532890
|
Loading…
Reference in New Issue
Block a user