瀏覽代碼

Merge pull request #90282 from jhlothamer/issue_84221

Fix sharing World2D between SubViewports causes 2D lights of one SubViewport to go missing
Rémi Verschelde 1 年之前
父節點
當前提交
e68f03a083
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      scene/2d/light_2d.cpp

+ 2 - 2
scene/2d/light_2d.cpp

@@ -203,7 +203,7 @@ void Light2D::_physics_interpolated_changed() {
 
 
 void Light2D::_notification(int p_what) {
 void Light2D::_notification(int p_what) {
 	switch (p_what) {
 	switch (p_what) {
-		case NOTIFICATION_ENTER_TREE: {
+		case NOTIFICATION_ENTER_CANVAS: {
 			RS::get_singleton()->canvas_light_attach_to_canvas(canvas_light, get_canvas());
 			RS::get_singleton()->canvas_light_attach_to_canvas(canvas_light, get_canvas());
 			_update_light_visibility();
 			_update_light_visibility();
 		} break;
 		} break;
@@ -227,7 +227,7 @@ void Light2D::_notification(int p_what) {
 			}
 			}
 		} break;
 		} break;
 
 
-		case NOTIFICATION_EXIT_TREE: {
+		case NOTIFICATION_EXIT_CANVAS: {
 			RS::get_singleton()->canvas_light_attach_to_canvas(canvas_light, RID());
 			RS::get_singleton()->canvas_light_attach_to_canvas(canvas_light, RID());
 			_update_light_visibility();
 			_update_light_visibility();
 		} break;
 		} break;