23 lines
557 B
TypeScript
23 lines
557 B
TypeScript
import { _decorator, Component, Node } from 'cc';
|
|
import { SkillCom } from './SkillCom';
|
|
import { smc } from '../common/SingletonModuleComp';
|
|
const { ccclass, property } = _decorator;
|
|
|
|
@ccclass('EndLineCom')
|
|
export class EndLineCom extends Component {
|
|
base:SkillCom = null
|
|
start() {
|
|
this.base =this.node.getComponent(SkillCom)
|
|
|
|
}
|
|
|
|
update(deltaTime: number) {
|
|
if(smc.mission.pause) return
|
|
if(this.node.position.x > 500 || this.node.position.x<-500){
|
|
this.base.is_destroy = true
|
|
}
|
|
}
|
|
}
|
|
|
|
|