技能动画添加
This commit is contained in:
20
assets/script/game/skills/timedCom.ts
Normal file
20
assets/script/game/skills/timedCom.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user