summaryrefslogtreecommitdiff
path: root/scene/2d/visibility_notifier_2d.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/2d/visibility_notifier_2d.cpp')
-rw-r--r--scene/2d/visibility_notifier_2d.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/scene/2d/visibility_notifier_2d.cpp b/scene/2d/visibility_notifier_2d.cpp
index 5411950976..852bc187d2 100644
--- a/scene/2d/visibility_notifier_2d.cpp
+++ b/scene/2d/visibility_notifier_2d.cpp
@@ -40,6 +40,9 @@ void VisibilityNotifier2D::_enter_viewport(Viewport* p_viewport) {
ERR_FAIL_COND(viewports.has(p_viewport));
viewports.insert(p_viewport);
+ if (is_inside_tree() && get_tree()->is_editor_hint())
+ return;
+
if (viewports.size()==1) {
emit_signal(SceneStringNames::get_singleton()->enter_screen);
@@ -54,6 +57,9 @@ void VisibilityNotifier2D::_exit_viewport(Viewport* p_viewport){
ERR_FAIL_COND(!viewports.has(p_viewport));
viewports.erase(p_viewport);
+ if (is_inside_tree() && get_tree()->is_editor_hint())
+ return;
+
emit_signal(SceneStringNames::get_singleton()->exit_viewport,p_viewport);
if (viewports.size()==0) {
emit_signal(SceneStringNames::get_singleton()->exit_screen);