Browse Source

Fix ParallaxLayer's transform resetting in editor

Disable resetting of ParallaxLayer's position and scale in editor to
allow setting the initial values.
SeleckyErik 3 years ago
parent
commit
7741afb55a
1 changed files with 4 additions and 0 deletions
  1. 4 0
      scene/2d/parallax_layer.cpp

+ 4 - 0
scene/2d/parallax_layer.cpp

@@ -100,6 +100,10 @@ void ParallaxLayer::_notification(int p_what) {
 			_update_mirroring();
 			_update_mirroring();
 		} break;
 		} break;
 		case NOTIFICATION_EXIT_TREE: {
 		case NOTIFICATION_EXIT_TREE: {
+			if (Engine::get_singleton()->is_editor_hint()) {
+				break;
+			}
+
 			set_position(orig_offset);
 			set_position(orig_offset);
 			set_scale(orig_scale);
 			set_scale(orig_scale);
 		} break;
 		} break;