This commit is contained in:
2025-12-02 18:48:32 +08:00
parent 92ba80b399
commit bf1ca60b3b
2357 changed files with 262694 additions and 7 deletions

View File

@@ -0,0 +1,19 @@
using UnityEngine;
using UnityEditor;
namespace Mirror
{
[CustomPropertyDrawer(typeof(ReadOnlyAttribute))]
public class ReadOnlyDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
// Cache the current GUI enabled state
bool prevGuiEnabledState = GUI.enabled;
GUI.enabled = false;
EditorGUI.PropertyField(position, property, label, true);
GUI.enabled = prevGuiEnabledState;
}
}
}