@galacean/engine-core 1.6.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.js CHANGED
@@ -7740,6 +7740,8 @@ function dependentComponents(componentOrComponents, dependentMode) {
7740
7740
  rotation._onValueChanged = target._onRotationChanged;
7741
7741
  // @ts-ignore
7742
7742
  scale._onValueChanged = target._onScaleChanged;
7743
+ // When cloning, other components may obtain properties such as `rotationQuaternion` in the constructor, local related dirty flags need to be corrected
7744
+ target._setDirtyFlagTrue(2 | 64);
7743
7745
  };
7744
7746
  _proto._onLocalMatrixChanging = function _onLocalMatrixChanging() {
7745
7747
  this._setDirtyFlagFalse(64);
@@ -21947,11 +21949,7 @@ var ComponentCloner = /*#__PURE__*/ function() {
21947
21949
  ], args));
21948
21950
  this._components.push(component);
21949
21951
  // @todo: temporary solution
21950
- if (_instanceof(component, Transform)) {
21951
- var transform = this._transform;
21952
- this._transform = component;
21953
- transform == null ? void 0 : transform.destroy();
21954
- }
21952
+ if (_instanceof(component, Transform)) this._setTransform(component);
21955
21953
  component._setActive(true, ActiveChangeFlag.All);
21956
21954
  return component;
21957
21955
  };
@@ -22380,6 +22378,16 @@ var ComponentCloner = /*#__PURE__*/ function() {
22380
22378
  }
22381
22379
  }
22382
22380
  };
22381
+ _proto._setTransform = function _setTransform(value) {
22382
+ var _this__transform;
22383
+ (_this__transform = this._transform) == null ? void 0 : _this__transform.destroy();
22384
+ this._transform = value;
22385
+ var children = this._children;
22386
+ for(var i = 0, n = children.length; i < n; i++){
22387
+ var _children_i_transform;
22388
+ (_children_i_transform = children[i].transform) == null ? void 0 : _children_i_transform._parentChange();
22389
+ }
22390
+ };
22383
22391
  /**
22384
22392
  * @deprecated
22385
22393
  */ _proto.getInvModelMatrix = function getInvModelMatrix() {