Files
speckle-unity/Assets/Speckle Connector/dmo/dScripts/dGUI/ReadOnlyAttribute.cs
T
2021-05-27 12:29:12 -04:00

26 lines
552 B
C#

using System.Collections.Generic;
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
#if UNITY_EDITOR
#endif
[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, true );
GUI.enabled = true;
}
}
public class ReadOnlyAttribute : PropertyAttribute { }