From d69e3791bf41dca6c29a9eb24bb92648cce2d692 Mon Sep 17 00:00:00 2001 From: reduz Date: Thu, 23 Jun 2022 08:19:18 +0200 Subject: Fix editor-only visibility for lights * Update visibility again for editor-only lights if owner changes. Fixes #26399, supersedes #52327 --- scene/2d/light_2d.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'scene/2d/light_2d.cpp') diff --git a/scene/2d/light_2d.cpp b/scene/2d/light_2d.cpp index 28d9b284e6..0481a58431 100644 --- a/scene/2d/light_2d.cpp +++ b/scene/2d/light_2d.cpp @@ -30,6 +30,11 @@ #include "light_2d.h" +void Light2D::owner_changed_notify() { + // For cases where owner changes _after_ entering tree (as example, editor editing). + _update_light_visibility(); +} + void Light2D::_update_light_visibility() { if (!is_inside_tree()) { return; -- cgit v1.2.3