Files
heros/assets/script/game/skills/once.ts
2024-09-23 08:14:39 +08:00

24 lines
562 B
TypeScript

import { _decorator, Component, Node, sp } from 'cc';
const { ccclass, property ,} = _decorator;
@ccclass('once')
export class once extends Component {
private spine!: sp.Skeleton;
start() {
this.spine.setAnimation(0, "animation", true);
}
protected onLoad(): void {
this.spine = this.node.getChildByName("skill").getComponent(sp.Skeleton)!;
this.spine.setCompleteListener(trackEntry => {
if(this.node.isValid) this.node.active = false;
});
}
update(deltaTime: number) {
}
}