英雄召唤精简+ 清理无用技能文件
This commit is contained in:
@@ -1,73 +0,0 @@
|
||||
import { _decorator, Animation, Collider2D, Component, Node, RigidBody2D, sp } from 'cc';
|
||||
import { SkillCom } from './SkillCom';
|
||||
import { BoxSet } from '../common/config/BoxSet';
|
||||
import { Hero } from '../hero/Hero';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('EndAnmBomCom')
|
||||
export class EndAnmBomCom extends Component {
|
||||
time:number = 0
|
||||
base:SkillCom = null
|
||||
collider:Collider2D = null
|
||||
is_complete:boolean = false
|
||||
start() {
|
||||
this.base =this.node.getComponent(SkillCom)
|
||||
this.collider = this.getComponent(Collider2D);
|
||||
|
||||
|
||||
|
||||
// this.collider.enabled = false
|
||||
// if(this.base.box_group ==BoxSet.HERO) this.collider.group = BoxSet.MONSTER
|
||||
// if(this.base.box_group ==BoxSet.MONSTER) this.collider.group = BoxSet.HERO
|
||||
|
||||
if(this.node.getComponent(Animation)){
|
||||
let anim = this.node.getComponent(Animation);
|
||||
console.log("has anim",anim)
|
||||
anim.on(Animation.EventType.FINISHED, this.onAnimationFinished, this);
|
||||
}
|
||||
if(this.node.getChildByName('anm')){
|
||||
if(this.node.getChildByName('anm').getComponent('sp.Skeleton')){
|
||||
var spine = this.node.getChildByName('anm').getComponent('sp.Skeleton') as sp.Skeleton;
|
||||
console.log("has spine",spine)
|
||||
spine.setCompleteListener((trackEntry) => {
|
||||
this.onAnimationFinished()
|
||||
console.log("[track %s][animation %s] complete: %s", trackEntry.trackIndex);
|
||||
});
|
||||
// spine.setEventListener((trackEntry, event:any) => {
|
||||
// this.onEnvent(event)
|
||||
// // console.log("[track %s][animation %s] event: %s", trackEntry.trackIndex, event.data.name, event.intValue);
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
onAnimationFinished(){
|
||||
// if(!this.is_complete){
|
||||
// // this.collider.group = this.base.box_group
|
||||
// // this.node.active=false
|
||||
// // this.node.active=true
|
||||
// this.rigid.wakeUp()
|
||||
// // this.collider.enabled = true
|
||||
// console.log("动画结束,开始伤害")
|
||||
// }
|
||||
|
||||
// this.collider.enabled = true
|
||||
console.log("动画结束,开始伤害")
|
||||
this.base.is_destroy = true
|
||||
|
||||
}
|
||||
onEnvent(event:any){
|
||||
if(event.data.name == "atk_event"){
|
||||
// this.collider.group = this.base.box_group
|
||||
// this.node.active=false
|
||||
// this.node.active=true
|
||||
|
||||
// this.collider.enabled = true
|
||||
console.log("onEnvent,开始伤害",event)
|
||||
this.is_complete=true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "455553b9-ad23-42a0-89d8-4d2906931212",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
import { _decorator, Animation, Component, Node, sp } from 'cc';
|
||||
import { SkillCom } from './SkillCom';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('EndAnmCom')
|
||||
export class EndAnmCom extends Component {
|
||||
start() {
|
||||
|
||||
if(this.node.getComponent(Animation)){
|
||||
let anim = this.node.getComponent(Animation);
|
||||
console.log("has anim",anim)
|
||||
anim.on(Animation.EventType.FINISHED, this.onAnimationFinished, this);
|
||||
}
|
||||
|
||||
if(this.node.getChildByName('anm')){
|
||||
if(this.node.getChildByName('anm').getComponent('sp.Skeleton')){
|
||||
var spine = this.node.getChildByName('anm').getComponent('sp.Skeleton') as sp.Skeleton;
|
||||
console.log("has spine",spine)
|
||||
spine.setCompleteListener((trackEntry) => {
|
||||
this.onAnimationFinished()
|
||||
console.log("[track %s][animation %s] complete: %s", trackEntry.trackIndex);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
onAnimationFinished(){
|
||||
console.log("动画播放完毕")
|
||||
let bese = this.node.getComponent(SkillCom)
|
||||
bese.is_destroy = true
|
||||
}
|
||||
update(deltaTime: number) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "9e0d3c9a-ca28-4530-a9ba-b2dfa4086dc3",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "2332add2-8701-4636-bd89-184f6f4893de",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "c92ad7af-330c-4161-86c5-8d5736e5e57d",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "6a7fe8c9-c479-4ce6-bfd3-4bc2051752aa",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
import { _decorator, Component, Node, tween, v3, Vec3 } from 'cc';
|
||||
import { SkillCom } from './SkillCom';
|
||||
import { smc } from '../common/SingletonModuleComp';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('LineCom')
|
||||
export class LineCom extends Component {
|
||||
base:SkillCom = null
|
||||
start() {
|
||||
this.base =this.node.getComponent(SkillCom)
|
||||
this.node.setPosition(this.node.position.x,this.node.position.y+50,this.node.position.z)
|
||||
}
|
||||
|
||||
update(deltaTime: number) {
|
||||
if(smc.mission.pause) return
|
||||
this.node.setPosition(this.node.position.x+this.base.speed*deltaTime*this.base.scale,this.node.position.y,this.node.position.z)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "2050354e-73b6-40f3-8b1b-a7c1bbda9c59",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
import { _decorator, Component, Node } from 'cc';
|
||||
import { SkillCom } from './SkillCom';
|
||||
import { BoxSet } from '../common/config/BoxSet';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('StartCom')
|
||||
export class StartCom extends Component {
|
||||
start() {
|
||||
this.node.setPosition(0,0)
|
||||
}
|
||||
|
||||
update(deltaTime: number) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "61a5611c-1772-4c97-be58-795e13f763f3",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
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) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "2e2390b0-a0cd-459a-847c-409e5e3ad3f3",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
import { _decorator, Component, Node } from 'cc';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('TgLineCom')
|
||||
export class TgLineCom extends Component {
|
||||
start() {
|
||||
|
||||
}
|
||||
|
||||
update(deltaTime: number) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "b7a2bf85-f71f-4c4c-bda0-e13e8730dd43",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
import { _decorator, Component, instantiate, Node, Prefab } from 'cc';
|
||||
import { SkillCom } from './SkillCom';
|
||||
import { ecs } from 'db://oops-framework/libs/ecs/ECS';
|
||||
import { Hero } from '../hero/Hero';
|
||||
import { BoxSet, FacSet } from '../common/config/BoxSet';
|
||||
import { Monster } from '../hero/Mon';
|
||||
import { HeroViewComp } from '../hero/HeroViewComp';
|
||||
import { smc } from '../common/SingletonModuleComp';
|
||||
import { oops } from 'db://oops-framework/core/Oops';
|
||||
import { HeroInfo } from '../common/config/heroSet';
|
||||
const { ccclass, property } = _decorator;
|
||||
//这是召唤技能
|
||||
@ccclass('ZhanCom')
|
||||
export class ZhanCom extends Component {
|
||||
base:SkillCom = null
|
||||
start() {
|
||||
console.log("ZhanCom:",this.base)
|
||||
this.base =this.node.getComponent(SkillCom)
|
||||
let pos = this.node.position
|
||||
let hero:any=null
|
||||
var path = "game/skills/dead";
|
||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||
var node = instantiate(prefab);
|
||||
node.parent = this.node.parent;
|
||||
node.setPosition(pos);
|
||||
if(this.base.fac==FacSet.HERO) {
|
||||
hero = ecs.getEntity<Hero>(Hero);
|
||||
let scale = 1
|
||||
hero.load(pos,scale,this.base.hero,true,HeroInfo[this.base.hero].lv);
|
||||
}
|
||||
if(this.base.fac==FacSet.MON) {
|
||||
hero = ecs.getEntity<Monster>(Monster);
|
||||
}
|
||||
}
|
||||
|
||||
update(deltaTime: number) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "eb0df9e9-d129-4d4b-b5ef-e63d068942e6",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
import { _decorator, Animation, Component, Node, sp } from 'cc';
|
||||
import { SkillCom } from './SkillCom';
|
||||
import { SkillSet } from '../common/config/SkillSet';
|
||||
import { ecs } from 'db://oops-framework/libs/ecs/ECS';
|
||||
import { Skill } from './Skill';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('seCom')
|
||||
export class seCom extends Component {
|
||||
base:SkillCom = null
|
||||
|
||||
start() {
|
||||
this.base =this.node.getComponent(SkillCom)
|
||||
if(this.node.getComponent(Animation)){
|
||||
let anim = this.node.getComponent(Animation);
|
||||
console.log("has anim",anim)
|
||||
anim.on(Animation.EventType.FINISHED, this.onAnimationFinished, this);
|
||||
}
|
||||
|
||||
if(this.node.getChildByName('anm')){
|
||||
if(this.node.getChildByName('anm').getComponent('sp.Skeleton')){
|
||||
var spine = this.node.getChildByName('anm').getComponent('sp.Skeleton') as sp.Skeleton;
|
||||
console.log("has spine",spine)
|
||||
spine.setCompleteListener((trackEntry) => {
|
||||
this.onAnimationFinished()
|
||||
console.log("[track %s][animation %s] complete: %s", trackEntry.trackIndex);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
update(deltaTime: number) {
|
||||
|
||||
}
|
||||
onAnimationFinished(){
|
||||
let skill = ecs.getEntity<Skill>(Skill);
|
||||
this.base.to_console("=>技能二段触发=>"+SkillSet[this.base.s_uuid].sonsk)
|
||||
skill.load(this.node.position,this.base.box_group,this.base.node,SkillSet[this.base.s_uuid].sonsk,this.base.ap,this.base.t_pos,this.base.is_crit,this.base.crit_add);
|
||||
this.base.is_destroy=true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "f5c0a714-f53b-40e4-9046-39b30f3997b7",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
Reference in New Issue
Block a user