This commit is contained in:
2025-03-30 16:06:57 +02:00
parent e62bd2aa6d
commit 623ba3f621
148 changed files with 2773 additions and 1441 deletions

View File

@@ -0,0 +1,23 @@
using RebootKit.Engine.Foundation;
using UnityEditor;
using UnityEngine;
namespace RebootKitEditor.PropertyDrawers {
[CustomPropertyDrawer(typeof(FloatRange))]
public class ValueRangeDrawer : PropertyDrawer {
const string k_minPropertyName = "min";
const string k_maxPropertyName = "max";
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) {
SerializedProperty minProperty = property.FindPropertyRelative(k_minPropertyName);
SerializedProperty maxProperty = property.FindPropertyRelative(k_maxPropertyName);
Vector2 minMax = EditorGUILayout.Vector2Field(label, new Vector2(minProperty.floatValue, maxProperty.floatValue));
if (minMax.x > minMax.y) minMax.y = minMax.x;
minProperty.floatValue = minMax.x;
maxProperty.floatValue = minMax.y;
}
}
}