技能+1
This commit is contained in:
37
assets/script/game/skills/LineMCom.ts
Normal file
37
assets/script/game/skills/LineMCom.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import { _decorator, Component, Node } from 'cc';
|
||||
import { SkillCom } from './SkillCom';
|
||||
import { smc } from '../common/SingletonModuleComp';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('LineMCom')
|
||||
export class LineMCom extends Component {
|
||||
base:SkillCom = null
|
||||
time:number = 0
|
||||
cd:number = 0
|
||||
start() {
|
||||
this.base =this.node.getComponent(SkillCom)
|
||||
|
||||
}
|
||||
|
||||
update(deltaTime: number) {
|
||||
if(smc.mission.pause) return
|
||||
if(smc.mission.pause) return
|
||||
this.cd+=deltaTime
|
||||
if(this.cd >= this.base.cd){
|
||||
// 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
|
||||
}
|
||||
this.node.setPosition(this.node.position.x+this.base.speed*deltaTime,this.node.position.y,this.node.position.z)
|
||||
if(this.node.position.x>1000||this.node.position.x<-1000){
|
||||
this.base.is_destroy = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
9
assets/script/game/skills/LineMCom.ts.meta
Normal file
9
assets/script/game/skills/LineMCom.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "47be4e93-d36a-4a9c-aa51-ea6616fac6d1",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -17,7 +17,7 @@ export class TgCom extends Component {
|
||||
update(deltaTime: number) {
|
||||
if(smc.mission.pause) return
|
||||
this.cd+=deltaTime
|
||||
if(this.cd>=1){
|
||||
if(this.cd>=this.base.cd){
|
||||
// this.node.setPosition(v3(-1000,0,0))
|
||||
this.node.active = false
|
||||
this.node.active = true
|
||||
|
||||
Reference in New Issue
Block a user