From f56238c7cc560d5bf65f42f159fa665e9834c195 Mon Sep 17 00:00:00 2001 From: zxg0622 <247274249@qq.com> Date: Wed, 8 Jan 2020 11:58:51 +0800 Subject: [PATCH] fix trail render error (#6046) --- cocos/particle/renderer/trail.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cocos/particle/renderer/trail.ts b/cocos/particle/renderer/trail.ts index cfe2a65707..593dea9e73 100644 --- a/cocos/particle/renderer/trail.ts +++ b/cocos/particle/renderer/trail.ts @@ -32,7 +32,8 @@ const _temp_vec3_1 = new Vec3(); const _temp_color = new Color(); const barycentric = [1, 0, 0, 0, 1, 0, 0, 0, 1]; // -const _bcIdx = 0; +// tslint:disable-next-line: prefer-const +let _bcIdx = 0; interface ITrailElement { position: Vec3; @@ -404,7 +405,7 @@ export default class TrailModule { public _updateMaterial () { if (this._particleSystem && this._trailModel) { - const mat = this._particleSystem.renderer.trailMaterial; + const mat = this._particleSystem.getMaterialInstance(1); if (mat) { this._trailModel.setSubModelMaterial(0, mat); } else {