Godot Version
Godot 4.6
Question
I need a way to store a class type in memory so I can check if a node inherits from the stored class later on, if you know what I mean. In C#, you can achieve this using the Type class:
// Store a class type
Type parentClass = typeof(ParentClass); // You can also use the GetType() method
Type childClass = typeof(ChildClass);
// Check if type inherits another
if (childClass.IsSubclassOf(parentClass))
{
// ...
}
I wonder if there’s a similar approach to this in GDScript. I’m writing some editor code that injects dependencies on nodes based on the type each property is expecting, so I’d need a Dictionary where each key is a property name, and each value is its expected type. Can someone help me?