Add support for virtual and abstract classes

This commit is contained in:
Ricardo Buring
2022-10-15 12:23:36 +02:00
parent 1044251a9e
commit 01960ffc9f
4 changed files with 40 additions and 3 deletions

View File

@@ -107,4 +107,18 @@ public:
VARIANT_ENUM_CAST(Example, Constants);
class ExampleVirtual : public Object {
GDCLASS(ExampleVirtual, Object);
protected:
static void _bind_methods() {}
};
class ExampleAbstract : public Object {
GDCLASS(ExampleAbstract, Object);
protected:
static void _bind_methods() {}
};
#endif // EXAMPLE_CLASS_H

View File

@@ -24,6 +24,8 @@ void initialize_example_module(ModuleInitializationLevel p_level) {
ClassDB::register_class<ExampleRef>();
ClassDB::register_class<ExampleMin>();
ClassDB::register_class<Example>();
ClassDB::register_class<ExampleVirtual>(true);
ClassDB::register_abstract_class<ExampleAbstract>();
}
void uninitialize_example_module(ModuleInitializationLevel p_level) {