RizzeBattleRoyale/Assets/Photon/FusionAddons/KCC/Editor/DisabledInPlayModeDrawer.cs
2025-09-24 11:24:38 +05:00

24 lines
643 B
C#

namespace Fusion.Addons.KCC
{
using UnityEngine;
using UnityEditor;
[CustomPropertyDrawer(typeof(DisabledInPlayModeAttribute))]
public sealed class DisabledInPlayModeDrawer : PropertyDrawer
{
// PropertyDrawer INTERFACE
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
EditorGUI.BeginDisabledGroup(Application.isPlaying);
EditorGUI.PropertyField(position, property, label, true);
EditorGUI.EndDisabledGroup();
}
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
{
return EditorGUI.GetPropertyHeight(property, label, true);
}
}
}