diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-02-15 18:06:48 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-02-15 18:44:55 +0100 |
commit | 0f5455230c8955be0c6533574bd3d5b6f50792b6 (patch) | |
tree | 2167f70782174feda2541c163d264c62402b50be /scene/2d/collision_polygon_2d.cpp | |
parent | 171021145d49ffdda9110869d35ee63a946af9f8 (diff) |
Use `switch` consistently in `_notification` (`scene` folder)
Diffstat (limited to 'scene/2d/collision_polygon_2d.cpp')
-rw-r--r-- | scene/2d/collision_polygon_2d.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/scene/2d/collision_polygon_2d.cpp b/scene/2d/collision_polygon_2d.cpp index 2923b287be..e3939130ec 100644 --- a/scene/2d/collision_polygon_2d.cpp +++ b/scene/2d/collision_polygon_2d.cpp @@ -102,26 +102,20 @@ void CollisionPolygon2D::_notification(int p_what) { _build_polygon(); _update_in_shape_owner(); } - - /*if (Engine::get_singleton()->is_editor_hint()) { - //display above all else - set_z_as_relative(false); - set_z_index(RS::CANVAS_ITEM_Z_MAX - 1); - }*/ - } break; + case NOTIFICATION_ENTER_TREE: { if (parent) { _update_in_shape_owner(); } - } break; + case NOTIFICATION_LOCAL_TRANSFORM_CHANGED: { if (parent) { _update_in_shape_owner(true); } - } break; + case NOTIFICATION_UNPARENTED: { if (parent) { parent->remove_shape_owner(owner_id); |