File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -1404,7 +1404,6 @@ cc.ParticleSystem = cc.Node.extend(/** @lends cc.ParticleSystem# */{
14041404 this . setTexture ( canvasObj ) ;
14051405 else
14061406 this . setTexture ( addTexture ) ;
1407-
14081407 }
14091408 }
14101409
@@ -1480,8 +1479,13 @@ cc.ParticleSystem = cc.Node.extend(/** @lends cc.ParticleSystem# */{
14801479 addParticle :function ( ) {
14811480 if ( this . isFull ( ) )
14821481 return false ;
1483-
1484- var particle = this . _particles [ this . _particleCount ] ;
1482+ var particle , particles = this . _particles ;
1483+ if ( cc . renderContextType === cc . CANVAS && this . _particleCount < particles . length ) {
1484+ particle = particles [ this . _particleCount ] ;
1485+ } else {
1486+ particle = new cc . Particle ( ) ;
1487+ particles . push ( particle ) ;
1488+ }
14851489 this . initParticle ( particle ) ;
14861490 ++ this . _particleCount ;
14871491 return true ;
You can’t perform that action at this time.
0 commit comments