diff --git a/cocos/particle-2d/particle-system-2d.ts b/cocos/particle-2d/particle-system-2d.ts index 87837d4d4f..74c55b0053 100644 --- a/cocos/particle-2d/particle-system-2d.ts +++ b/cocos/particle-2d/particle-system-2d.ts @@ -193,6 +193,7 @@ export class ParticleSystem2D extends UIRenderer { if (this._custom !== value) { this._custom = value; this._applyFile(); + this._updateMaterial(); } } @@ -1170,13 +1171,11 @@ export class ParticleSystem2D extends UIRenderer { * @deprecated since v3.5.0, this is an engine private interface that will be removed in the future. */ public _updateMaterial () { - if (!this._useFile) { - if (this._customMaterial) { - this.setMaterial(this._customMaterial, 0); - const target = this.getRenderMaterial(0)!.passes[0].blendState.targets[0]; - this._dstBlendFactor = target.blendDst; - this._srcBlendFactor = target.blendSrc; - } + if (this._customMaterial) { + this.setMaterial(this._customMaterial, 0); + const target = this.getRenderMaterial(0)!.passes[0].blendState.targets[0]; + this._dstBlendFactor = target.blendDst; + this._srcBlendFactor = target.blendSrc; } const mat = this.getMaterialInstance(0); if (mat) mat.recompileShaders({ USE_LOCAL: this._positionType !== PositionType.FREE });