init
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
using RPGCoreCommon.Helpers.PropertyAttributeDrawers;
|
||||
using UnityEditor;
|
||||
using UnityEditor.UIElements;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
namespace RPGCoreCommon.Helpers.Editor.PropertyAttributeDrawers
|
||||
{
|
||||
[CustomPropertyDrawer(typeof(ReadOnlyAttribute))]
|
||||
public class ReadOnlyDrawer : PropertyDrawer
|
||||
{
|
||||
public override VisualElement CreatePropertyGUI(SerializedProperty property)
|
||||
{
|
||||
var propertyField = new PropertyField(property);
|
||||
propertyField.name = "ReadOnly";
|
||||
propertyField.RegisterCallback<GeometryChangedEvent>(_ => propertyField.SetEnabled(false));
|
||||
return propertyField;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user