技能动画 继续完善
This commit is contained in:
14
assets/script/game/skills/AnmEndCom.ts
Normal file
14
assets/script/game/skills/AnmEndCom.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { _decorator, Component, Node } from 'cc';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('AnmEndCom')
|
||||
export class AnmEndCom extends Component {
|
||||
start() {
|
||||
|
||||
}
|
||||
|
||||
update(deltaTime: number) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "3a728fd7-22ba-4bcf-bb88-588390346a31",
|
||||
"uuid": "9a6c0cbd-2b5b-4ecd-85d3-c017de7a5b2a",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
@@ -2,13 +2,15 @@ import { _decorator, Animation, Component, Node } from 'cc';
|
||||
import { SkillCom } from './SkillCom';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('OnceCom')
|
||||
export class OnceCom extends Component {
|
||||
start() {
|
||||
@ccclass('EndAnmCom')
|
||||
export class EndAnmCom extends Component {
|
||||
start() {
|
||||
let anim = this.node.getComponent(Animation);
|
||||
console.log("动画",anim)
|
||||
anim.on(Animation.EventType.FINISHED, this.onAnimationFinished, this);
|
||||
}
|
||||
onAnimationFinished(){
|
||||
console.log("动画播放完毕")
|
||||
let bese = this.node.getComponent(SkillCom)
|
||||
bese.is_destroy = true
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "34a04999-1c8d-4380-b218-59d8a41818a6",
|
||||
"uuid": "9e0d3c9a-ca28-4530-a9ba-b2dfa4086dc3",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
20
assets/script/game/skills/EndBoxCom.ts
Normal file
20
assets/script/game/skills/EndBoxCom.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { _decorator, Collider2D, Component, Contact2DType, Node } from 'cc';
|
||||
import { SkillCom } from './SkillCom';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('EndBoxCom')
|
||||
export class EndBoxCom extends Component {
|
||||
base:SkillCom = null
|
||||
start() {
|
||||
this.base =this.node.getComponent(SkillCom)
|
||||
let collider = this.getComponent(Collider2D);
|
||||
if (collider) {
|
||||
collider.on(Contact2DType.BEGIN_CONTACT, this.onBeginContact, this);
|
||||
}
|
||||
}
|
||||
onBeginContact (seCol: Collider2D, otCol: Collider2D) {
|
||||
if(otCol.group != seCol.group&&otCol.tag ==0)this.base.is_destroy=true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
9
assets/script/game/skills/EndBoxCom.ts.meta
Normal file
9
assets/script/game/skills/EndBoxCom.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "2332add2-8701-4636-bd89-184f6f4893de",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
22
assets/script/game/skills/EndLineCom.ts
Normal file
22
assets/script/game/skills/EndLineCom.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
9
assets/script/game/skills/EndLineCom.ts.meta
Normal file
9
assets/script/game/skills/EndLineCom.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "c92ad7af-330c-4161-86c5-8d5736e5e57d",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
23
assets/script/game/skills/EndTimeCom.ts
Normal file
23
assets/script/game/skills/EndTimeCom.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { _decorator, Component, Node } from 'cc';
|
||||
import { SkillCom } from './SkillCom';
|
||||
import { smc } from '../common/SingletonModuleComp';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('EndTimeCom')
|
||||
export class EndTimeCom extends Component {
|
||||
time:number = 0
|
||||
base:SkillCom = null
|
||||
start() {
|
||||
this.base =this.node.getComponent(SkillCom)
|
||||
}
|
||||
|
||||
update(deltaTime: number) {
|
||||
if(smc.mission.pause) return
|
||||
this.time+=deltaTime
|
||||
if(this.time>=this.base.in_time){
|
||||
this.base.is_destroy = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
9
assets/script/game/skills/EndTimeCom.ts.meta
Normal file
9
assets/script/game/skills/EndTimeCom.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "6a7fe8c9-c479-4ce6-bfd3-4bc2051752aa",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -14,9 +14,6 @@ export class LineCom extends Component {
|
||||
update(deltaTime: number) {
|
||||
if(smc.mission.pause) return
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ export class LineMCom extends Component {
|
||||
}
|
||||
|
||||
update(deltaTime: number) {
|
||||
if(smc.mission.pause) return
|
||||
if(smc.mission.pause) return
|
||||
this.cd+=deltaTime
|
||||
if(this.cd >= this.base.cd){
|
||||
@@ -23,14 +22,8 @@ export class LineMCom extends Component {
|
||||
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
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
import { _decorator, Component, Node, tween, Vec3 } from 'cc';
|
||||
import { SkillCom } from './SkillCom';
|
||||
import { SkillSet } from '../common/config/SkillSet';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('NoRunCom')
|
||||
export class NoRunCom extends Component {
|
||||
base:SkillCom
|
||||
start() {
|
||||
this.base =this.node.getComponent(SkillCom)
|
||||
|
||||
}
|
||||
|
||||
update(deltaTime: number) {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,6 @@ export class Skill extends ecs.Entity {
|
||||
sv.debuff = SkillSet[uuid].debuff;
|
||||
sv.depb = SkillSet[uuid].depb;
|
||||
sv.derate = SkillSet[uuid].derate;
|
||||
sv.run = SkillSet[uuid].run;
|
||||
sv.is_crit=is_crit
|
||||
sv.crit_add=crit_add
|
||||
// node.setScale(v3(node.scale.x*scale,node.scale.y))
|
||||
|
||||
@@ -60,9 +60,6 @@ export class SkillCom extends CCComp {
|
||||
onBeginContact (seCol: Collider2D, otCol: Collider2D, contact: IPhysics2DContact | null) {
|
||||
if(otCol.group != seCol.group&&otCol.tag ==0){
|
||||
this.atk_count+=1
|
||||
if(this.run==1 ){
|
||||
this.is_destroy=true
|
||||
}
|
||||
}
|
||||
if(otCol.group == seCol.group&&otCol.tag ==0&&(this.tg==2||this.tg==0)){
|
||||
this.to_console("skill onBeginContact 是对自己人的buff",seCol,otCol)
|
||||
|
||||
@@ -14,7 +14,7 @@ export class timedCom extends Component {
|
||||
}
|
||||
|
||||
update(deltaTime: number) {
|
||||
this.time = this.time - deltaTime;
|
||||
this.time -= deltaTime;
|
||||
if(this.time <= 0)
|
||||
{
|
||||
this.node.destroy()
|
||||
|
||||
Reference in New Issue
Block a user