增加A2WToolBox工具集,增加Launch场景核LaunchPanel

This commit is contained in:
Wurui
2025-11-08 11:06:48 +08:00
parent 3e92e5684a
commit 3b43829e85
726 changed files with 87807 additions and 215 deletions

View File

@@ -0,0 +1,38 @@
using UnityEngine;
using UnityEditor;
using System;
namespace NaughtyAttributes.Editor
{
[CustomPropertyDrawer(typeof(EnumFlagsAttribute))]
public class EnumFlagsPropertyDrawer : PropertyDrawerBase
{
protected override float GetPropertyHeight_Internal(SerializedProperty property, GUIContent label)
{
Enum targetEnum = PropertyUtility.GetTargetObjectOfProperty(property) as Enum;
return (targetEnum != null)
? GetPropertyHeight(property)
: GetPropertyHeight(property) + GetHelpBoxHeight();
}
protected override void OnGUI_Internal(Rect rect, SerializedProperty property, GUIContent label)
{
EditorGUI.BeginProperty(rect, label, property);
Enum targetEnum = PropertyUtility.GetTargetObjectOfProperty(property) as Enum;
if (targetEnum != null)
{
Enum enumNew = EditorGUI.EnumFlagsField(rect, label.text, targetEnum);
property.intValue = (int)Convert.ChangeType(enumNew, targetEnum.GetType());
}
else
{
string message = attribute.GetType().Name + " can be used only on enums";
DrawDefaultPropertyAndHelpBox(rect, property, message, MessageType.Warning);
}
EditorGUI.EndProperty();
}
}
}