mirror of
https://github.com/godotengine/godot-cpp.git
synced 2026-01-03 18:09:13 +03:00
Fix _notification with parent and child classes
This commit is contained in:
@@ -220,6 +220,31 @@ protected:
|
||||
virtual int test_function() override { return 25; }
|
||||
};
|
||||
|
||||
class ExampleBase : public Node {
|
||||
GDCLASS(ExampleBase, Node);
|
||||
|
||||
protected:
|
||||
int value1 = 0;
|
||||
int value2 = 0;
|
||||
|
||||
static void _bind_methods();
|
||||
|
||||
void _notification(int p_what);
|
||||
|
||||
public:
|
||||
int get_value1() { return value1; }
|
||||
int get_value2() { return value2; }
|
||||
};
|
||||
|
||||
class ExampleChild : public ExampleBase {
|
||||
GDCLASS(ExampleChild, ExampleBase);
|
||||
|
||||
protected:
|
||||
static void _bind_methods() {}
|
||||
|
||||
void _notification(int p_what);
|
||||
};
|
||||
|
||||
class ExampleRuntime : public Node {
|
||||
GDCLASS(ExampleRuntime, Node);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user