Files
heros/assets/script/game/skills/BuffGet.ts

36 lines
1.3 KiB
TypeScript

import { _decorator, Component, Node, tween, v3, Vec3 } from 'cc';
const { ccclass, property } = _decorator;
@ccclass('BuffGet')
export class BuffGet extends Component {
start() {
this.scheduleOnce(()=>{
tween(this.node).to( 0.2,
{ position: new Vec3(this.node.position.x,this.node.position.y+100) },
{
onComplete:()=>{ this.node.destroy() }
}
).start();
}, 3);
}
init(name:string){
this.node.getChildByName("ap").active=(name=="ap")
this.node.getChildByName("cd").active=(name=="cd")
this.node.getChildByName("def").active=(name=="def")
this.node.getChildByName("hp").active=(name=="hp")
this.node.getChildByName("crit").active=(name=="crit")
this.node.getChildByName("dodge").active=(name=="dodge")
this.node.getChildByName("deap").active=(name=="deap")
this.node.getChildByName("decd").active=(name=="decd")
this.node.getChildByName("dedef").active=(name=="dedef")
this.node.getChildByName("dehp").active=(name=="dehp")
this.node.getChildByName("decrit").active=(name=="decrit")
this.node.getChildByName("dedodge").active=(name=="dedodge")
}
update(deltaTime: number) {
}
}