فهرست منبع

Fix TouchScreenButton error spam

kobewi 3 سال پیش
والد
کامیت
db19cc60fb
1فایلهای تغییر یافته به همراه1 افزوده شده و 3 حذف شده
  1. 1 3
      scene/2d/touch_screen_button.cpp

+ 1 - 3
scene/2d/touch_screen_button.cpp

@@ -190,7 +190,7 @@ String TouchScreenButton::get_action() const {
 void TouchScreenButton::input(const Ref<InputEvent> &p_event) {
 	ERR_FAIL_COND(p_event.is_null());
 
-	if (!get_tree()) {
+	if (!is_visible_in_tree()) {
 		return;
 	}
 
@@ -198,8 +198,6 @@ void TouchScreenButton::input(const Ref<InputEvent> &p_event) {
 		return;
 	}
 
-	ERR_FAIL_COND(!is_visible_in_tree());
-
 	const InputEventScreenTouch *st = Object::cast_to<InputEventScreenTouch>(*p_event);
 
 	if (passby_press) {