import { _decorator, Component, Node, v3 } from 'cc'; import { SkillCom } from './SkillCom'; import { BoxSet } from '../common/config/BoxSet'; import { smc } from '../common/SingletonModuleComp'; 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) { if(smc.mission.pause) return 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 } } }