add unity project for engine customization

This commit is contained in:
2025-06-11 08:16:42 +02:00
parent 6d78ed5a7a
commit 0ae837c57b
146 changed files with 68448 additions and 0 deletions
@@ -0,0 +1,36 @@
using UnityEditor;
using UnityEngine;
namespace Data
{
[CustomPropertyDrawer(typeof(Ability))]
public class AbilityDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
position = EditorGUI.PrefixLabel(position, label);
// next to each other
// float width = position.width;
// position.width *= 0.45f;
// EditorGUI.PropertyField(position, property.FindPropertyRelative("Name"), GUIContent.none);
//
// position.x += (width - position.width);
// EditorGUI.PropertyField(position, property.FindPropertyRelative("Value"), GUIContent.none);
// below each other
position.height = EditorGUIUtility.singleLineHeight;
EditorGUI.PropertyField(position, property.FindPropertyRelative("Name"), GUIContent.none);
position.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
EditorGUI.PropertyField(position, property.FindPropertyRelative("Value"), GUIContent.none);
}
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
{
// return EditorGUIUtility.singleLineHeight; // next to each other
return EditorGUIUtility.singleLineHeight * 2 + EditorGUIUtility.standardVerticalSpacing; // below each other
}
}
}