prevent bug due to scripts not working in editor and notifier sending signals to it.
This commit is contained in:
parent
df6dbadc3e
commit
37b5e99bc2
@ -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 New Issue
Block a user