Files
pixelheros/assets/script/game/skills/timedCom.ts
2025-01-05 09:10:21 +08:00

21 lines
358 B
TypeScript

import { _decorator, Component, Node } from 'cc';
const { ccclass, property } = _decorator;
@ccclass('timedCom')
export class timedCom extends Component {
time = 0.3;
start() {
}
update(deltaTime: number) {
this.time = this.time - deltaTime;
if(this.time <= 0)
{
this.node.destroy()
}
}
}