技能改spine 怪物增加
This commit is contained in:
29
assets/script/game/skills/CdCom.ts
Normal file
29
assets/script/game/skills/CdCom.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import { _decorator, Component, Node, tween, Vec3 } from 'cc';
|
||||
import { SkillCom } from './SkillCom';
|
||||
import { HeroViewComp } from '../hero/HeroViewComp';
|
||||
import { smc } from '../common/SingletonModuleComp';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('CdCom')
|
||||
export class CdCom extends Component {
|
||||
cd:number = 0;
|
||||
base:SkillCom = null
|
||||
time:number = 0;
|
||||
start() {
|
||||
this.base =this.node.getComponent(SkillCom)
|
||||
}
|
||||
|
||||
update(deltaTime: number) {
|
||||
if(smc.mission.pause) return
|
||||
this.cd+=deltaTime
|
||||
if(this.cd>=this.base.cd){
|
||||
if(this.base.is_destroy) return
|
||||
// this.node.setPosition(v3(-1000,0,0))
|
||||
this.node.active = false
|
||||
this.node.active = true
|
||||
this.cd=0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user