mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 08:02:39 +08:00
Fix the error when deactive node in onLoad. (#8326)
This commit is contained in:
@@ -80,7 +80,7 @@ function stableRemoveInactive (iterator, flagToClear) {
|
||||
let next = iterator.i + 1;
|
||||
while (next < array.length) {
|
||||
const comp = array[next];
|
||||
if (comp._enabled && comp.node._activeInHierarchy) {
|
||||
if (comp.node._activeInHierarchy) {
|
||||
++next;
|
||||
} else {
|
||||
iterator.removeAt(next);
|
||||
|
||||
@@ -673,15 +673,6 @@ export class ParticleSystem2D extends Renderable2D {
|
||||
public declare _renderSpriteFrame: SpriteFrame | null;
|
||||
public declare _simulator: Simulator;
|
||||
|
||||
/**
|
||||
* @en Play particle in edit mode.
|
||||
* @zh 在编辑器模式下预览粒子,启用后选中粒子时,粒子将自动播放。
|
||||
*/
|
||||
@serializable
|
||||
@editable
|
||||
@tooltip('i18n:particle_system.preview')
|
||||
private preview = true;
|
||||
|
||||
/**
|
||||
* @en If set to true, the particle system will automatically start playing on onLoad.
|
||||
* @zh 如果设置为 true 运行时会自动发射粒子。
|
||||
@@ -689,7 +680,7 @@ export class ParticleSystem2D extends Renderable2D {
|
||||
@serializable
|
||||
@editable
|
||||
@tooltip('i18n:particle_system.playOnLoad')
|
||||
private playOnLoad = true;
|
||||
public playOnLoad = true;
|
||||
|
||||
/**
|
||||
* @en Indicate whether the owner node will be auto-removed when it has no particles left.
|
||||
@@ -698,8 +689,16 @@ export class ParticleSystem2D extends Renderable2D {
|
||||
@serializable
|
||||
@editable
|
||||
@tooltip('i18n:particle_system.autoRemoveOnFinish')
|
||||
private autoRemoveOnFinish = false;
|
||||
public autoRemoveOnFinish = false;
|
||||
|
||||
/**
|
||||
* @en Play particle in edit mode.
|
||||
* @zh 在编辑器模式下预览粒子,启用后选中粒子时,粒子将自动播放。
|
||||
*/
|
||||
@serializable
|
||||
@editable
|
||||
@tooltip('i18n:particle_system.preview')
|
||||
private preview = true;
|
||||
@serializable
|
||||
private _custom = false;
|
||||
@serializable
|
||||
|
||||
Reference in New Issue
Block a user