31 lines
759 B
TypeScript
31 lines
759 B
TypeScript
import { _decorator, Component, Node, v3 } from 'cc';
|
|
import { SkillCom } from './SkillCom';
|
|
const { ccclass, property } = _decorator;
|
|
|
|
@ccclass('TgCom')
|
|
export class TgCom extends Component {
|
|
time:number = 0
|
|
cd:number = 0
|
|
base:SkillCom = null
|
|
start() {
|
|
this.base =this.node.getComponent(SkillCom)
|
|
this.node.setPosition(this.base.t_pos)
|
|
}
|
|
|
|
update(deltaTime: number) {
|
|
this.cd+=deltaTime
|
|
if(this.cd>=1){
|
|
// this.node.setPosition(v3(-1000,0,0))
|
|
this.node.active = false
|
|
this.node.active = true
|
|
this.cd=0
|
|
}
|
|
this.time+=deltaTime
|
|
if(this.time>=this.base.in_time){
|
|
this.base.is_destroy = true
|
|
}
|
|
}
|
|
}
|
|
|
|
|