19 lines
426 B
C#
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;
|
|
}
|
|
}
|
|
}
|