From e14f2fa3368b501ad80f740868a518af09db045d Mon Sep 17 00:00:00 2001 From: Jare Guo Date: Mon, 1 Feb 2016 17:37:55 +0800 Subject: [PATCH] particle should not auto remove in editor --- cocos2d/particle/CCParticleSystem.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/cocos2d/particle/CCParticleSystem.js b/cocos2d/particle/CCParticleSystem.js index 230a616868..408f808a3a 100644 --- a/cocos2d/particle/CCParticleSystem.js +++ b/cocos2d/particle/CCParticleSystem.js @@ -106,10 +106,10 @@ var properties = { else { this._applyFile(); } - cc.engine.repaintInEditMode(); - //if (CC_EDITOR) { + if (CC_EDITOR) { + cc.engine.repaintInEditMode(); // self.preview = self.preview; - //} + } } }, animatable: false @@ -743,7 +743,9 @@ var ParticleSystem = cc.Class({ } sgNode.setPosition(0, 0); - sgNode.autoRemoveOnFinish = self._autoRemoveOnFinish; + if (!CC_EDITOR || cc.engine.isPlaying) { + self._applyAutoRemove(); + } // @@ -770,7 +772,10 @@ var ParticleSystem = cc.Class({ if (!active) { sgNode.stopSystem(); } - sgNode.autoRemoveOnFinish = this._autoRemoveOnFinish; + + if (!CC_EDITOR || cc.engine.isPlaying) { + this._applyAutoRemove(); + } }, _applyAutoRemove: function () {