20 lines
408 B
TypeScript
20 lines
408 B
TypeScript
|
|
const {ccclass, property} = cc._decorator;
|
|
|
|
@ccclass
|
|
export default class SmokeEff extends cc.Component {
|
|
|
|
start () {
|
|
this.node.runAction(cc.moveBy(0.5,cc.v2(0,Math.random()*60+100)))
|
|
var call=cc.callFunc(this.onAniEnd,this)
|
|
var seq=cc.sequence(cc.delayTime(0.2),cc.fadeOut(0.5))
|
|
this.node.runAction(seq)
|
|
|
|
}
|
|
onAniEnd()
|
|
{
|
|
this.node.destroy();
|
|
}
|
|
|
|
}
|