Firstborn/Library/PackageCache/com.unity.addressables@1.19.19/Editor/GUI/AddressableReadOnlyAttribut...

20 lines
638 B
C#
Raw Normal View History

using System;
using UnityEngine;
namespace UnityEditor.AddressableAssets.GUI
{
[AttributeUsage(AttributeTargets.Field)]
internal class AddressableReadOnly : PropertyAttribute { }
[CustomPropertyDrawer(typeof(AddressableReadOnly))]
internal class AddressableReadOnlyDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
EditorGUI.LabelField(position, label);
EditorGUI.BeginDisabledGroup(true);
EditorGUI.PropertyField(position, property);
EditorGUI.EndDisabledGroup();
}
}
}