using UnityEditor; using UnityEngine.UIElements; namespace EditorAttributes.Editor { [CustomPropertyDrawer(typeof(HideInPlayModeAttribute))] public class HideInPlayModeDrawer : PropertyDrawerBase { public override VisualElement CreatePropertyGUI(SerializedProperty property) { var root = new VisualElement(); if (!EditorApplication.isPlayingOrWillChangePlaymode) root.Add(CreatePropertyField(property)); return root; } } }