英雄召唤精简+ 清理无用技能文件
This commit is contained in:
@@ -366,15 +366,15 @@ export const UpgradeResourceConfig = {
|
||||
// 经验值配置
|
||||
experience: {
|
||||
base: 100, // 初始值:1级升2级所需经验
|
||||
growth: 1.5, // 增长值:每级增长倍数
|
||||
bonus: 0.2 // 增长值提升比例:5级倍数提升20%
|
||||
growth: 50, // 增长值:每级增长倍数
|
||||
bonus: 100 // 增长值提升比例:5级倍数提升20%
|
||||
},
|
||||
|
||||
// 金币配置
|
||||
gold: {
|
||||
base: 50, // 初始值:1级升2级所需金币
|
||||
growth: 1.3, // 增长值:每级增长倍数
|
||||
bonus: 0.15 // 增长值提升比例:5级倍数提升15%
|
||||
growth: 100, // 增长值:每级增长倍数
|
||||
bonus: 500 // 增长值提升比例:5级倍数提升15%
|
||||
}
|
||||
};
|
||||
|
||||
@@ -385,13 +385,13 @@ export const UpgradeResourceConfig = {
|
||||
*/
|
||||
export const getUpgradeExperience = (level: number): number => {
|
||||
if (level <= 0) return 0;
|
||||
|
||||
let next_level=level+1
|
||||
const config = UpgradeResourceConfig.experience;
|
||||
let result = config.base * Math.pow(config.growth, level - 1);
|
||||
let result = config.base + config.growth * (next_level - 1);
|
||||
|
||||
// 5级倍数提升
|
||||
if (level % 5 === 0) {
|
||||
result = result * (1 + config.bonus);
|
||||
if (next_level % 5 === 0) {
|
||||
result = result + config.bonus*next_level;
|
||||
}
|
||||
|
||||
return Math.floor(result);
|
||||
@@ -404,13 +404,13 @@ export const getUpgradeExperience = (level: number): number => {
|
||||
*/
|
||||
export const getUpgradeGold = (level: number): number => {
|
||||
if (level <= 0) return 0;
|
||||
|
||||
let next_level=level+1
|
||||
const config = UpgradeResourceConfig.gold;
|
||||
let result = config.base * Math.pow(config.growth, level - 1);
|
||||
let result = config.base + config.growth * (next_level - 1);
|
||||
|
||||
// 5级倍数提升
|
||||
if (level % 5 === 0) {
|
||||
result = result * (1 + config.bonus);
|
||||
if (next_level % 5 === 0) {
|
||||
result = result + config.bonus*next_level;
|
||||
}
|
||||
|
||||
return Math.floor(result);
|
||||
|
||||
@@ -5,7 +5,7 @@ import { smc } from "../common/SingletonModuleComp";
|
||||
import { HeroModelComp } from "./HeroModelComp";
|
||||
import { HeroViewComp } from "./HeroViewComp";
|
||||
import { BoxSet, FacSet } from "../common/config/BoxSet";
|
||||
import { HeroInfo, HeroPos, HType } from "../common/config/heroSet";
|
||||
import { getHeroStatsByLevel, HeroInfo, HeroPos, HType } from "../common/config/heroSet";
|
||||
import { BattleMoveComp } from "../common/ecs/position/BattleMoveComp";
|
||||
import { GameEvent } from "../common/config/GameEvent";
|
||||
import { BuffAttr, getBuffNum, SkillSet } from "../common/config/SkillSet";
|
||||
@@ -36,7 +36,7 @@ export class Hero extends ecs.Entity {
|
||||
|
||||
|
||||
/** 加载角色 */
|
||||
load(pos: Vec3 = Vec3.ZERO,scale:number = 1,uuid:number=1001,info:any={ap:0,hp:0,lv:1,crit:0,crit_d:0,dod:0,dod_no:false,crit_no:false},fight_pos:number=1) {
|
||||
load(pos: Vec3 = Vec3.ZERO,scale:number = 1,uuid:number=1001,fight_pos:number=1) {
|
||||
// console.log("英雄加载:",uuid,pos,scale,info)
|
||||
scale = 1
|
||||
// 查找空闲英雄槽位
|
||||
@@ -48,7 +48,7 @@ export class Hero extends ecs.Entity {
|
||||
node.parent = scene.entityLayer!.node!
|
||||
node.setPosition(pos)
|
||||
// console.log("hero load",pos)
|
||||
var hv = this.hero_init(uuid,node,info)
|
||||
var hv = this.hero_init(uuid,node)
|
||||
this.add(hv);
|
||||
oops.message.dispatchEvent(GameEvent.MasterCalled,{uuid:uuid})
|
||||
const move = this.get(BattleMoveComp);
|
||||
@@ -62,13 +62,15 @@ export class Hero extends ecs.Entity {
|
||||
}
|
||||
smc.vmdata.mission_data.hero_num++
|
||||
}
|
||||
hero_init(uuid:number=1001,node:Node,info:any={ap:0,hp:0,lv:1,crit:0,crit_d:0,dod:0,dod_no:false,crit_no:false}) {
|
||||
hero_init(uuid:number=1001,node:Node) {
|
||||
var hv = node.getComponent(HeroViewComp)!;
|
||||
let hero= HeroInfo[uuid] // 共用英雄数据
|
||||
let hero_lv=smc.heros[uuid].lv
|
||||
let {hp,ap,def}=getHeroStatsByLevel(uuid,hero_lv)
|
||||
hv.scale = 1;
|
||||
hv.is_master=true;
|
||||
hv.lv=1
|
||||
hv.lv=info.lv
|
||||
hv.lv=hero_lv
|
||||
hv.fac = FacSet.HERO;
|
||||
hv.type = hero.type;
|
||||
hv.box_group = BoxSet.HERO;
|
||||
@@ -78,8 +80,9 @@ export class Hero extends ecs.Entity {
|
||||
hv.Attrs[BuffAttr.SPEED]=hv.speed = hero.speed;
|
||||
hv.Attrs[BuffAttr.DIS]=hv.dis=hero.dis;
|
||||
hv.Attrs[BuffAttr.ATK_CD]=hv.cd=hero.cd
|
||||
hv.Attrs[BuffAttr.HP_MAX]=hv.hp=hv.hp_max=hero.hp+info.hp
|
||||
hv.Attrs[BuffAttr.AP]=hv.ap=hero.ap+info.ap;
|
||||
hv.Attrs[BuffAttr.HP_MAX]=hv.hp=hv.hp_max=hp
|
||||
hv.Attrs[BuffAttr.AP]=hv.ap=ap;
|
||||
hv.Attrs[BuffAttr.DEF]=def
|
||||
hero.buff.forEach((buff:any)=>{
|
||||
hv.apply_buff(buff.type,buff.value)
|
||||
})
|
||||
|
||||
@@ -30,7 +30,7 @@ export class Monster extends ecs.Entity {
|
||||
}
|
||||
|
||||
/** 加载角色 */
|
||||
load(pos: Vec3 = Vec3.ZERO,scale:number = 1,uuid:number=1001,is_boss:boolean=false,is_call:boolean=false,lv:number=1,enhancement?: any, stageMultipliers?: any) {
|
||||
load(pos: Vec3 = Vec3.ZERO,scale:number = 1,uuid:number=1001,is_boss:boolean=false,is_call:boolean=false,enhancement?: any, stageMultipliers?: any) {
|
||||
scale=-1
|
||||
let box_group=BoxSet.MONSTER
|
||||
console.log("mon load",uuid)
|
||||
@@ -45,7 +45,7 @@ export class Monster extends ecs.Entity {
|
||||
const collider = node.getComponent(BoxCollider2D);
|
||||
if (collider) collider.enabled = false; // 先禁用 // 延迟一帧启用碰撞体
|
||||
node.setPosition(pos)
|
||||
this.hero_init(uuid,node,scale,box_group,is_boss,is_call,lv,enhancement,stageMultipliers)
|
||||
this.hero_init(uuid,node,scale,box_group,is_boss,is_call,enhancement,stageMultipliers)
|
||||
oops.message.dispatchEvent("monster_load",this)
|
||||
|
||||
// 初始化移动参数
|
||||
@@ -62,7 +62,7 @@ export class Monster extends ecs.Entity {
|
||||
node.parent = scene.entityLayer!.node!
|
||||
node.setPosition(pos)
|
||||
}
|
||||
hero_init(uuid:number=1001,node:Node,scale:number=1,box_group=BoxSet.HERO,is_boss:boolean=false,is_call:boolean=false,lv:number=1,enhancement?: any, stageMultipliers?: any) {
|
||||
hero_init(uuid:number=1001,node:Node,scale:number=1,box_group=BoxSet.HERO,is_boss:boolean=false,is_call:boolean=false,enhancement?: any, stageMultipliers?: any) {
|
||||
var hv = node.getComponent(HeroViewComp)!;
|
||||
hv.hide_info()
|
||||
// console.log("hero_init",buff)
|
||||
|
||||
@@ -206,7 +206,7 @@ export class MissionMonCompComp extends CCComp { // 添加刷怪队列 - 使
|
||||
let pos: Vec3 = v3(MonSet[i].pos);
|
||||
|
||||
// 生成怪物,传递增强属性和关卡倍数
|
||||
mon.load(pos, scale, uuid, is_boss, is_call, lv, enhancement, stageMultipliers);
|
||||
mon.load(pos,scale,uuid,is_boss,is_call,enhancement, stageMultipliers);
|
||||
|
||||
// 如果有增强属性,记录到控制台
|
||||
if (enhancement && enhancement.buffList && enhancement.buffList.length > 0) {
|
||||
|
||||
@@ -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