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,39 @@
using UnityEditor;
namespace RebootKitEditor.Utils {
public struct CVarSerializedProperties {
public SerializedProperty flags;
public SerializedProperty name;
public SerializedProperty description;
public SerializedProperty defaultValueKind;
public SerializedProperty defaultValueNumber;
public SerializedProperty defaultValueString;
}
public static class CVarSerializedPropertiesFinder {
const string k_CVarFlagsProperty = "name";
const string k_CVarNameProperty = "name";
const string k_CVarDescriptionProperty = "description";
const string k_CVarDefaultValueProperty = "defaultValue";
const string k_CVarDefaultValueKindProperty = "kind";
const string k_CVarDefaultValueNumberValueProperty = "numberValue";
const string k_CVarDefaultValueStringValueProperty = "stringValue";
public static CVarSerializedProperties Find(SerializedProperty cvar) {
CVarSerializedProperties properties = new();
properties.flags = cvar.FindPropertyRelative(k_CVarFlagsProperty);
properties.name = cvar.FindPropertyRelative(k_CVarNameProperty);
properties.description = cvar.FindPropertyRelative(k_CVarDescriptionProperty);
SerializedProperty value = cvar.FindPropertyRelative(k_CVarDefaultValueProperty);
if (value != null) {
properties.defaultValueKind = value.FindPropertyRelative(k_CVarDefaultValueKindProperty);
properties.defaultValueNumber = value.FindPropertyRelative(k_CVarDefaultValueNumberValueProperty);
properties.defaultValueString = value.FindPropertyRelative(k_CVarDefaultValueStringValueProperty);
}
return properties;
}
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: b244cfd75ae64aeebe0299f28ec08267
timeCreated: 1742499696