const {ccclass, property} = cc._decorator;
@ccclass
export default class NewClass extends cc.Component {
@property(cc.Node)
particle:cc.Node = null
toggleParticlePlay()
{
let myParticle:cc.ParticleSystem = this.particle.getComponent(cc.ParticleSystem);
if (myParticle.particleCount > 0) {
myParticle.stopSystem(); //停止播放粒子
} else {
myParticle.resetSystem(); //粒子效果重新播放
}
}
}