Files
heros/assets/script/game/skills/EndTimeCom.ts
2025-01-10 16:50:18 +08:00

24 lines
570 B
TypeScript

import { _decorator, Component, Node } from 'cc';
import { SkillCom } from './SkillCom';
import { smc } from '../common/SingletonModuleComp';
const { ccclass, property } = _decorator;
@ccclass('EndTimeCom')
export class EndTimeCom extends Component {
time:number = 0
base:SkillCom = null
start() {
this.base =this.node.getComponent(SkillCom)
}
update(deltaTime: number) {
if(smc.mission.pause) return
this.time+=deltaTime
if(this.time>=this.base.in_time){
this.base.is_destroy = true
}
}
}