c1_unity/Assets/Editor/InspectorTools/EnumFlagsDrawer.cs
2023-04-03 11:04:31 +08:00

17 lines
405 B
C#

using System;
using UnityEngine;
using UnityEditor;
using BF;
namespace BFEditor
{
[CustomPropertyDrawer(typeof(EnumFlagsAttribute))]
public class EnumFlagsDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
property.intValue = EditorGUI.MaskField(position, label, property.intValue, property.enumNames);
}
}
}