system
1
|
|
|
|
Attention |
Topic was automatically imported from the old Question2Answer platform. |
|
Asked By |
YanDaik |
How to check if a variable is a type of custom class (extended from Node3D) with c++?
system
2
|
|
|
|
Reply From: |
YanDaik |
void SomeClass::test_method(godot::Object *object)
{
godot::Reference *r = godot::Object::cast_to<godot::Reference>(object);
if (r) {
r->reference();
}
SomeCustomType *custom = godot::Object::cast_to<SomeCustomType>(object);
if (custom) {
custom->some_custom_method();
}
}