Renamed all attributes and drawers to have postfix of either Attribute or AttributeDrawer
This commit is contained in:
parent
81bac32538
commit
dc15bfec81
161 changed files with 265 additions and 265 deletions
32
Editor/Decorators/MethodHeaderAttributeDrawer.cs
Normal file
32
Editor/Decorators/MethodHeaderAttributeDrawer.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Module.Inspector.Editor
|
||||
{
|
||||
[CustomMethodDrawer(typeof(MethodHeaderAttribute))]
|
||||
public sealed class MethodHeaderAttributeDrawer : DecoratorMethodDrawer
|
||||
{
|
||||
public override bool Draw(Rect position, DecoratorMethodAttribute attribute)
|
||||
{
|
||||
var att = (MethodHeaderAttribute)attribute;
|
||||
|
||||
if (string.IsNullOrEmpty(att.title))
|
||||
return false;
|
||||
|
||||
var style = new GUIStyle(GUI.skin.label)
|
||||
{
|
||||
fontStyle = FontStyle.Bold,
|
||||
alignment = TextAnchor.LowerLeft
|
||||
};
|
||||
|
||||
EditorGUI.LabelField(position, att.title, style);
|
||||
return true;
|
||||
}
|
||||
|
||||
public override float GetHeight(DecoratorMethodAttribute attribute)
|
||||
{
|
||||
var att = (MethodHeaderAttribute)attribute;
|
||||
return !string.IsNullOrEmpty(att.title) ? EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing : 0.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue