@galacean/engine-core 1.1.0-beta.29 → 1.1.0-beta.30

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/main.js CHANGED
@@ -2632,20 +2632,28 @@ var ActiveChangeFlag;
2632
2632
  this._enabled = value;
2633
2633
  if (this._entity._isActiveInScene) {
2634
2634
  if (value) {
2635
- this._phasedActiveInScene = true;
2636
- this._onEnableInScene();
2635
+ if (!this._phasedActiveInScene) {
2636
+ this._phasedActiveInScene = true;
2637
+ this._onEnableInScene();
2638
+ }
2637
2639
  } else {
2638
- this._phasedActiveInScene = false;
2639
- this._onDisableInScene();
2640
+ if (this._phasedActiveInScene) {
2641
+ this._phasedActiveInScene = false;
2642
+ this._onDisableInScene();
2643
+ }
2640
2644
  }
2641
2645
  }
2642
2646
  if (this._entity.isActiveInHierarchy) {
2643
2647
  if (value) {
2644
- this._phasedActive = true;
2645
- this._onEnable();
2648
+ if (!this._phasedActive) {
2649
+ this._phasedActive = true;
2650
+ this._onEnable();
2651
+ }
2646
2652
  } else {
2647
- this._phasedActive = false;
2648
- this._onDisable();
2653
+ if (this._phasedActive) {
2654
+ this._phasedActive = false;
2655
+ this._onDisable();
2656
+ }
2649
2657
  }
2650
2658
  }
2651
2659
  }