You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-17 14:11:06 +00:00
Fix monitoring status of Area2D
This commit is contained in:
@@ -380,6 +380,10 @@ void Area2D::_notification(int p_what) {
|
|||||||
|
|
||||||
switch (p_what) {
|
switch (p_what) {
|
||||||
|
|
||||||
|
case NOTIFICATION_READY: {
|
||||||
|
|
||||||
|
is_ready = true;
|
||||||
|
} break;
|
||||||
case NOTIFICATION_EXIT_TREE: {
|
case NOTIFICATION_EXIT_TREE: {
|
||||||
|
|
||||||
monitoring_stored = monitoring;
|
monitoring_stored = monitoring;
|
||||||
@@ -387,8 +391,8 @@ void Area2D::_notification(int p_what) {
|
|||||||
_clear_monitoring();
|
_clear_monitoring();
|
||||||
} break;
|
} break;
|
||||||
case NOTIFICATION_ENTER_TREE: {
|
case NOTIFICATION_ENTER_TREE: {
|
||||||
|
if (is_ready)
|
||||||
set_enable_monitoring(monitoring_stored);
|
set_enable_monitoring(monitoring_stored);
|
||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -646,7 +650,8 @@ Area2D::Area2D()
|
|||||||
monitorable = false;
|
monitorable = false;
|
||||||
collision_mask = 1;
|
collision_mask = 1;
|
||||||
layer_mask = 1;
|
layer_mask = 1;
|
||||||
monitoring_stored = true;
|
monitoring_stored = false;
|
||||||
|
is_ready = false;
|
||||||
set_enable_monitoring(true);
|
set_enable_monitoring(true);
|
||||||
set_monitorable(true);
|
set_monitorable(true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ private:
|
|||||||
bool monitoring_stored;
|
bool monitoring_stored;
|
||||||
bool monitorable;
|
bool monitorable;
|
||||||
bool locked;
|
bool locked;
|
||||||
|
bool is_ready;
|
||||||
|
|
||||||
void _body_inout(int p_status, const RID &p_body, int p_instance, int p_body_shape, int p_area_shape);
|
void _body_inout(int p_status, const RID &p_body, int p_instance, int p_body_shape, int p_area_shape);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user