First commit
This commit is contained in:
16
Editor/ReadOnlyFieldDrawer.cs
Normal file
16
Editor/ReadOnlyFieldDrawer.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Agoxandr.Utils
|
||||
{
|
||||
[CustomPropertyDrawer(typeof(ReadOnlyFieldAttribute))]
|
||||
public class ReadOnlyFieldDrawer : PropertyDrawer
|
||||
{
|
||||
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
|
||||
{
|
||||
GUI.enabled = false;
|
||||
EditorGUI.PropertyField(position, property, label, true);
|
||||
GUI.enabled = true;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user