Files
bansonic_beta_main/Assets/BlurRawImage/Scripts/Utils/MiracleAttributes.cs
T

24 lines
583 B
C#

using System;
using UnityEditor;
using UnityEngine;
namespace Qjjxk.Blur
{
[AttributeUsage(AttributeTargets.Field)]
public class ReadOnlyAttribute : PropertyAttribute
{
}
#if UNITY_EDITOR
[CustomPropertyDrawer(typeof(ReadOnlyAttribute))]
public class ReadOnlyDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
GUI.enabled = false;
EditorGUI.PropertyField(position, property, label);
GUI.enabled = true;
}
}
#endif
}