From 42bf8caf6855074cd87bded2751a8f0bf9619023 Mon Sep 17 00:00:00 2001 From: Jare Guo Date: Tue, 1 Mar 2016 18:32:52 +0800 Subject: [PATCH] fix custom particle texture --- cocos2d/particle/CCParticleSystem.js | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/cocos2d/particle/CCParticleSystem.js b/cocos2d/particle/CCParticleSystem.js index 94cbd5579e..c2ff34743a 100644 --- a/cocos2d/particle/CCParticleSystem.js +++ b/cocos2d/particle/CCParticleSystem.js @@ -575,7 +575,7 @@ var ParticleSystem = cc.Class({ this._previewTimer = null; this._focused = false; this._willStart = false; - this._blendFunc = new cc.BlendFunc(this._srcBlendFactor, this._dstBlendFactor); + this._blendFunc = new cc.BlendFunc(0, 0); }, properties: properties, @@ -676,13 +676,21 @@ var ParticleSystem = cc.Class({ _initSgNode: function () { var sgNode = this._sgNode; - var loadCustomAfterFile = false; if (this._file) { - var missCustomTexture = this._custom && !this._texture; - loadCustomAfterFile = missCustomTexture; - this._applyFile(loadCustomAfterFile && this._applyCustoms.bind(this)); + if (this._custom) { + var missCustomTexture = !this._texture; + if (missCustomTexture) { + this._applyFile(this._applyCustoms.bind(this)); + } + else { + this._applyCustoms(); + } + } + else { + this._applyFile(); + } } - if (this._custom && !loadCustomAfterFile) { + else if (this._custom) { this._applyCustoms(); }