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.1, { position: new Vec3(this.node.position.x,this.node.position.y+50) }, { onComplete:()=>{ this.node.destroy() } } ).start(); }, 1); } 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) { } }