destroyed proj

This commit is contained in:
2025-03-15 12:37:32 +01:00
parent be2b7c5a44
commit 4872192479
426 changed files with 22755 additions and 3101 deletions

View File

@@ -0,0 +1,55 @@
using RebootKit.Engine.Services.Console;
using UnityEditor;
using UnityEditor.UIElements;
using UnityEngine.UIElements;
namespace RebootKitEditor.Inspectors {
[CustomEditor(typeof(CVarAsset))]
public class CVarAssetInspector : Editor {
public override VisualElement CreateInspectorGUI() {
SerializedProperty cvarProperty = serializedObject.FindProperty("_cvar");
CVarSerializedProperties properties = CVarSerializedPropertiesFinder.Find(cvarProperty);
VisualElement container = new();
container.Add(new PropertyField(properties.Flags));
container.Add(new PropertyField(properties.Name));
PropertyField descriptionField = new PropertyField(properties.Description);
container.Add(descriptionField);
container.Add(new PropertyField(properties.ValueKind));
container.Add(new PropertyField(properties.ValueNumber));
container.Add(new PropertyField(properties.ValueString));
return container;
}
}
public struct CVarSerializedProperties {
public SerializedProperty Flags;
public SerializedProperty Name;
public SerializedProperty Description;
public SerializedProperty ValueKind;
public SerializedProperty ValueNumber;
public SerializedProperty ValueString;
}
public static class CVarSerializedPropertiesFinder {
public static CVarSerializedProperties Find(SerializedProperty cvar) {
CVarSerializedProperties properties = new();
properties.Flags = cvar.FindPropertyRelative("Flags");
properties.Name = cvar.FindPropertyRelative("Name");
properties.Description = cvar.FindPropertyRelative("Description");
SerializedProperty value = cvar.FindPropertyRelative("DefaultValue");
if (value != null) {
properties.ValueKind = value.FindPropertyRelative("Kind");
properties.ValueNumber = value.FindPropertyRelative("NumberValue");
properties.ValueString = value.FindPropertyRelative("StringValue");
}
return properties;
}
}
}