This commit is contained in:
2025-04-14 23:22:38 +02:00
parent 72b8a37345
commit 1e190fe94b
166 changed files with 2989 additions and 687 deletions

View File

@@ -4,7 +4,7 @@ using UnityEditor;
using UnityEngine;
namespace RebootKitEditor.PropertyDrawers {
[CustomPropertyDrawer(typeof(CVar))]
[CustomPropertyDrawer(typeof(ConfigVar))]
public class CVarDrawer : PropertyDrawer {
bool m_Expand;

View File

@@ -0,0 +1,38 @@
using RebootKit.Engine.Foundation;
using UnityEditor;
using UnityEngine;
namespace RebootKitEditor.PropertyDrawers {
[CustomPropertyDrawer(typeof(ConstsProperty<>))]
public class ConstsPropertyDrawer : PropertyDrawer {
const string k_InlineValue = "m_InlineValue";
const string k_Asset = "m_Asset";
const string k_UseInlineValue = "m_UseInlineValue";
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) {
SerializedProperty useInlineValue = property.FindPropertyRelative(k_UseInlineValue);
SerializedProperty inlineValue = property.FindPropertyRelative(k_InlineValue);
SerializedProperty asset = property.FindPropertyRelative(k_Asset);
EditorGUI.BeginProperty(position, label, property);
GUILayout.BeginHorizontal();
EditorGUILayout.LabelField(label, EditorStyles.miniBoldLabel);
if (useInlineValue.boolValue) {
EditorGUILayout.PropertyField(inlineValue, GUIContent.none);
} else {
EditorGUILayout.PropertyField(asset, GUIContent.none);
}
if (GUILayout.Button(useInlineValue.boolValue ? "Inline" : "Asset", GUILayout.MaxWidth(100))) {
useInlineValue.boolValue = !useInlineValue.boolValue;
}
GUILayout.EndHorizontal();
EditorGUI.EndProperty();
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: d7ed7ab023f349a4a4b50ee7a4029178
timeCreated: 1743848631