Category item view button list

This commit is contained in:
Kamila Stawarska 2023-11-09 12:04:53 +01:00
parent cd8c819585
commit da89d7a7fc
2 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,23 @@
using UnityEditor;
using UnityEngine;
namespace NegUtils.Editor
{
public class ReadOnlyAttribute : PropertyAttribute { }
[CustomPropertyDrawer(typeof(ReadOnlyAttribute))]
public class ReadOnlyPropertyDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
GUI.enabled = false;
EditorGUI.PropertyField(position, property, label, true);
GUI.enabled = true;
}
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
{
return EditorGUI.GetPropertyHeight(property, label, true);
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 1f837bac3a7b40528454a9fb9a46d0be
timeCreated: 1699371332