WuhuIslandTesting/Library/PackageCache/com.unity.addressables@1.21.12/Editor/GUI/AddressableReadOnlyAttribute.cs
2025-01-07 02:06:59 +01:00

22 lines
647 B
C#

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();
}
}
}