This commit is contained in:
MuHua-123
2025-06-17 10:53:45 +08:00
parent c6d9b71e95
commit 5374616980
87 changed files with 2265 additions and 1019 deletions
@@ -0,0 +1,23 @@
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using MuHua;
namespace MuHuaEditor {
/// <summary>
/// 定义对带有 `CustomLabelAttribute` 特性的字段的面板内容的绘制行为。
/// </summary>
[CustomPropertyDrawer(typeof(CustomLabelAttribute))]
public class CustomLabelDrawer : PropertyDrawer {
private GUIContent _label = null;
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) {
if (_label == null) {
string name = (attribute as CustomLabelAttribute).name;
_label = new GUIContent(name);
}
EditorGUI.PropertyField(position, property, _label);
}
}
}