case3
This commit is contained in:
29
Assets/ThirdParty/BOXOPHOBIC/Utils/Editor/StyledInspector/StyledDisplayDrawer.cs
vendored
Normal file
29
Assets/ThirdParty/BOXOPHOBIC/Utils/Editor/StyledInspector/StyledDisplayDrawer.cs
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
// Cristian Pop - https://boxophobic.com/
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
namespace Boxophobic.StyledGUI
|
||||
{
|
||||
[CustomPropertyDrawer(typeof(StyledDisplay))]
|
||||
public class StyledDisplayAttributeDrawer : PropertyDrawer
|
||||
{
|
||||
StyledDisplay a;
|
||||
|
||||
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
|
||||
{
|
||||
a = (StyledDisplay)attribute;
|
||||
|
||||
// Override the default label
|
||||
label.text = a.displayName;
|
||||
|
||||
EditorGUI.PropertyField(position, property, label, true);
|
||||
}
|
||||
|
||||
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
|
||||
{
|
||||
return EditorGUI.GetPropertyHeight(property, label, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user