From 7a553576ef53bd83d73daaedd911d647b7fd2f4c Mon Sep 17 00:00:00 2001 From: cary <39078800+caryliu1999@users.noreply.github.com> Date: Mon, 27 Jul 2020 22:26:20 +0800 Subject: [PATCH] Fix the particle build error when culling checked. (#7031) --- cocos/particle/particle-system-component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/particle/particle-system-component.ts b/cocos/particle/particle-system-component.ts index 545f3096ee..345e11c952 100644 --- a/cocos/particle/particle-system-component.ts +++ b/cocos/particle/particle-system-component.ts @@ -989,6 +989,6 @@ export class ParticleSystemComponent extends RenderableComponent { } public _onBeforeSerialize (props) { - return this.enableCulling ? props.filter(p => !PARTICLE_MODULE_PROPERTY.includes(p) || this[p].enable) : props; + return this.enableCulling ? props.filter(p => !PARTICLE_MODULE_PROPERTY.includes(p) || (this[p] && this[p].enable)) : props; } }