Fix editor-only visibility for lights

* Update visibility again for editor-only lights if owner changes.

Fixes #26399, supersedes #52327
This commit is contained in:
reduz
2022-06-23 08:19:18 +02:00
parent abb92861f4
commit d69e3791bf
6 changed files with 20 additions and 0 deletions

View File

@@ -176,6 +176,11 @@ Ref<Texture2D> Light3D::get_projector() const {
return projector;
}
void Light3D::owner_changed_notify() {
// For cases where owner changes _after_ entering tree (as example, editor editing).
_update_visibility();
}
void Light3D::_update_visibility() {
if (!is_inside_tree()) {
return;