playFire: function(){
var a = this.fire.getComponent(cc.ParticleSystem);
var red = Math.random()*255;
var green = Math.random()*255;
var blue = Math.random()*255;
cc.log(red+","+green+","+blue+",")
a.endColor=new cc.Color(red, green, blue);
var f2 = cc.instantiate(this.fire);
var scene = cc.director.getScene();
f2.parent = scene;
this.fire.x = 480-Math.random() * 480*2;
this.fire.y = 320-Math.random() * 320*2;
f2.x = Math.random() * 480*2;
f2.y = Math.random() * 320*2;
var b = f2.getComponent(cc.ParticleSystem);
b.endColor=new cc.Color(red, green, blue);
a.resetSystem();
b.resetSystem();
cc.audioEngine.playEffect(this.soundClip, false);
},
想通过使用instantiate克隆出一个粒子,但克隆出来的粒子属性设置都不生效,求大神赐教!!!
,感谢jare大神哈,感谢cocos引擎!