prevent bug due to scripts not working in editor and notifier sending signals to it.
(cherry picked from commit 37b5e99bc2
)
This commit is contained in:
parent
58556f5f95
commit
569966f3bb
1 changed files with 6 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue