Files
test/Assets/EditorAttributes/Editor/Scripts/Drawers/MiscellaneousAttributeDrawers/ReadonlyDrawer.cs
T

19 lines
426 B
C#

using UnityEditor;
using UnityEngine.UIElements;
namespace EditorAttributes.Editor
{
[CustomPropertyDrawer(typeof(ReadOnlyAttribute))]
public class ReadonlyDrawer : PropertyDrawerBase
{
public override VisualElement CreatePropertyGUI(SerializedProperty property)
{
var propertyField = CreatePropertyField(property);
propertyField.SetEnabled(false);
return propertyField;
}
}
}