import { _decorator, Component, Node, v3 } from 'cc'; import { SkillCom } from './SkillCom'; import { BoxSet } from '../common/config/BoxSet'; 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) if(this.base.box_group==BoxSet.MONSTER){ this.base.t_pos.x=-1*this.base.t_pos.x } 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 } } }