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