卡牌技能
This commit is contained in:
@@ -26,4 +26,6 @@ export enum BoxSet {
|
||||
END_POINT = 360,
|
||||
//游戏地平线
|
||||
GAME_LINE = 0,
|
||||
CSKILL_X = 200,
|
||||
CSKILL_Y = 500,
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
export const MissionNum = 3
|
||||
export const MissionNum = [1,2,3]
|
||||
export const MonsetList = {
|
||||
1:{
|
||||
1:[1101,1102,],
|
||||
|
||||
@@ -7,38 +7,72 @@ import { BoxSet } from "../common/config/BoxSet";
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
||||
import { MapViewScene } from "./view/MapViewScene";
|
||||
|
||||
import { MissionSet,MissionNum,MonsetList } from "../common/config/MissionSet";
|
||||
import { RandomManager } from "../../../../extensions/oops-plugin-framework/assets/core/common/random/RandomManager";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** 视图层对象 */
|
||||
@ccclass('MapMonsterComp')
|
||||
@ecs.register('MapMonster', false)
|
||||
export class MapMonsterComp extends CCComp {
|
||||
scene: MapViewScene = null;
|
||||
current_map: any;
|
||||
|
||||
private monster_refresh_rtimer: Timer = new Timer(1);
|
||||
async onLoad(){
|
||||
// scene: MapViewScene = null;
|
||||
max_count: number = 99 ; //最大波次
|
||||
cur_count: number = 1; //波次
|
||||
boss_count: number = 10; //boss波次间隔
|
||||
monster_level:number = 1; //怪物池等级
|
||||
max_monster_level:number = 4; //最高怪物次等级
|
||||
min_monster_num:number = 2; ///最小每次刷新怪物数量
|
||||
max_monster_num:number = 2; //最大每次刷新怪物数量
|
||||
refresh_timer: Timer = new Timer(5); // 刷新怪物定时器
|
||||
refresh_cd: Timer = new Timer(0.5);
|
||||
mission_up_timer: Timer = new Timer(30); //波次增加
|
||||
cur_mission:number = 1; //当前关卡方案
|
||||
mission_list:any = []
|
||||
setp_timer: Timer = new Timer(0.5);
|
||||
setp_num:number = 2;
|
||||
onLoad(){
|
||||
// 监听全局事件
|
||||
oops.message.on("do_add_monster", this.on_do_add_monster, this);
|
||||
|
||||
|
||||
}
|
||||
start() {
|
||||
// this.scene = this.getComponent(MapViewScene);
|
||||
let num =RandomManager.instance.getRandomByObjectList(MissionNum,1)
|
||||
this.cur_mission = num[0]
|
||||
this.mission_list = MonsetList[this.cur_mission]
|
||||
console.log("当前关卡方案",this.cur_mission,this.mission_list)
|
||||
this.refresh_timer= new Timer(smc.vm_data.gold.cd);
|
||||
this.monster_refresh()
|
||||
}
|
||||
protected update(dt: number): void {
|
||||
if (this.monster_refresh_rtimer.update(dt)) {
|
||||
// 刷新怪物定时器
|
||||
if(this.setp_timer.update(dt)){
|
||||
this.monster_refresh()
|
||||
}
|
||||
if (this.refresh_timer.update(dt)) {
|
||||
this.setp_num = RandomManager.instance.getRandomInt(this.max_monster_num,this.max_monster_level,2)
|
||||
}
|
||||
if (this.mission_up_timer.update(dt)) {
|
||||
// 刷新怪物定时器
|
||||
this.cur_count += 1;
|
||||
}
|
||||
// if (this.game_timer.update(dt)) {
|
||||
// smc.vm_data.game.g_time += 1;
|
||||
// }
|
||||
// this.shuaxin(dt)
|
||||
}
|
||||
monster_refresh(){
|
||||
if(smc.monsters.length > 0 ){
|
||||
this.addMonster(smc.monsters[0].uuid)
|
||||
if (this.setp_num <= 0){
|
||||
return
|
||||
}
|
||||
console.log("当前波数",this.cur_count)
|
||||
console.log("当前怪物池",this.mission_list[this.monster_level])
|
||||
let m:any = RandomManager.instance.getRandomByObjectList(this.mission_list[this.monster_level],1)
|
||||
console.log("刷怪",m)
|
||||
this.addMonster(m[0])
|
||||
this.setp_num -= 1
|
||||
}
|
||||
private addMonster(uuid:number=1101) {
|
||||
|
||||
let monster = ecs.getEntity<Monster>(Monster);
|
||||
let pos:Vec3 = v3(BoxSet.MONSTER_START,BoxSet.GAME_LINE)
|
||||
let camp = -1
|
||||
@@ -50,10 +84,7 @@ export class MapMonsterComp extends CCComp {
|
||||
// this.addMonster(args.uuid)
|
||||
}
|
||||
/** 视图层逻辑代码分离演示 */
|
||||
start() {
|
||||
this.scene = this.getComponent(MapViewScene);
|
||||
|
||||
}
|
||||
|
||||
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||
reset() {
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
import { _decorator ,Prefab,instantiate,Node} from "cc";
|
||||
import { _decorator ,v3,Prefab,instantiate,Node} from "cc";
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
||||
import { BoxSet } from "../common/config/BoxSet";
|
||||
|
||||
import { MapViewScene } from "./view/MapViewScene";
|
||||
import { CSkill } from "../monster/CSkill";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** 视图层对象 */
|
||||
@ccclass('MapSkillComp')
|
||||
@ecs.register('MapSkill', false)
|
||||
export class MapSkillComp extends CCComp {
|
||||
// scene: MapViewScene = null;
|
||||
@property(Prefab)
|
||||
light: Prefab = null;
|
||||
onLoad(){
|
||||
@@ -18,19 +20,24 @@ export class MapSkillComp extends CCComp {
|
||||
oops.message.on("do_use_skill", this.doSkill, this);
|
||||
}
|
||||
doSkill(){
|
||||
// console.log("doSkill")
|
||||
this.addSkill();
|
||||
}
|
||||
addSkill(uuid:number=1001){
|
||||
let csk =ecs.getEntity<CSkill>(CSkill);
|
||||
let camp = 1
|
||||
let pos = v3(BoxSet.CSKILL_X*-camp,BoxSet.CSKILL_Y)
|
||||
csk.load(pos,camp,uuid);
|
||||
}
|
||||
doMonsterLoad(){
|
||||
|
||||
// const light = instantiate(this.light);
|
||||
// light.setPosition(300,-30,0);
|
||||
// this.node.addChild(light);
|
||||
}
|
||||
doHeroLoad(){
|
||||
// console.log(this.light)
|
||||
// const light = instantiate(this.light);
|
||||
// light.setPosition(BoxSet.HERO_START,BoxSet.GAME_LINE,0);
|
||||
// this.node.addChild(light);
|
||||
console.log(this.light)
|
||||
const light = instantiate(this.light);
|
||||
light.setPosition(BoxSet.HERO_START,BoxSet.GAME_LINE,0);
|
||||
this.node.addChild(light);
|
||||
}
|
||||
/** 视图层逻辑代码分离演示 */
|
||||
start() {
|
||||
|
||||
@@ -25,7 +25,9 @@ export default class EntityLayer extends Component {
|
||||
// this.node.children.sort(this.zIndexSort);
|
||||
}
|
||||
|
||||
|
||||
protected start(): void {
|
||||
console.log("EntityLayer start")
|
||||
}
|
||||
|
||||
public clear() {
|
||||
this.node.children.forEach(n => {
|
||||
|
||||
@@ -36,9 +36,9 @@ export default class SkillLayer extends Component {
|
||||
// this.node.addChild(light);
|
||||
}
|
||||
doHeroLoad(){
|
||||
const light = instantiate(this.light);
|
||||
light.setPosition(BoxSet.HERO_START,BoxSet.GAME_LINE,0);
|
||||
this.node.addChild(light);
|
||||
// const light = instantiate(this.light);
|
||||
// light.setPosition(BoxSet.HERO_START,BoxSet.GAME_LINE,0);
|
||||
// this.node.addChild(light);
|
||||
}
|
||||
update(dt: number) {
|
||||
// this.timer.update(dt)
|
||||
@@ -46,7 +46,9 @@ export default class SkillLayer extends Component {
|
||||
// this.node.children.sort(this.zIndexSort);
|
||||
}
|
||||
|
||||
|
||||
start(){
|
||||
console.log("SkillLayer start")
|
||||
}
|
||||
|
||||
public clear() {
|
||||
this.node.children.forEach(n => {
|
||||
|
||||
61
assets/script/game/monster/CSkill.ts
Normal file
61
assets/script/game/monster/CSkill.ts
Normal file
@@ -0,0 +1,61 @@
|
||||
import { Prefab,instantiate,Vec3,v3 ,SpriteAtlas,resources,Sprite,Node} from "cc";
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { CSkillComp } from "./CSkillComp";
|
||||
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
/** CSkill 模块 */
|
||||
@ecs.register(`CSkill`)
|
||||
export class CSkill extends ecs.Entity {
|
||||
CSkillView!: CSkillComp;
|
||||
/** 实始添加的数据层组件 */
|
||||
protected init() {
|
||||
|
||||
}
|
||||
|
||||
/** 模块资源释放 */
|
||||
destroy() {
|
||||
// 注: 自定义释放逻辑,视图层实现 ecs.IComp 接口的 ecs 组件需要手动释放
|
||||
super.destroy();
|
||||
}
|
||||
start(){
|
||||
|
||||
}
|
||||
|
||||
/** 加载角色 */
|
||||
load(pos: Vec3 = Vec3.ZERO,camp:number = 1,uuid:number=1001) {
|
||||
// var path = "game/monster/"+prefab_path;
|
||||
|
||||
var path = "game/heros/skill";
|
||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||
var node = instantiate(prefab);
|
||||
var scene = smc.map.MapView.scene;
|
||||
node.parent = scene.entityLayer!.node!;
|
||||
node.getChildByName("skill").setScale(node.getChildByName("skill").scale.x*camp, node.getChildByName("skill").scale.y, node.getChildByName("skill").scale.z);
|
||||
node.setPosition(pos)
|
||||
// console.log(node.getChildByName("avatar").getChildByName("TNode").getChildByName("bb").getComponent(Sprite))
|
||||
const url = 'game/heros/skill';
|
||||
resources.load(url, SpriteAtlas, (err: any, atlas) => {
|
||||
const sprite = node.getChildByName("skill").getComponent(Sprite);
|
||||
sprite.spriteFrame = atlas.getSpriteFrame('1002');
|
||||
});
|
||||
this.skill_init(uuid,node,pos)
|
||||
oops.message.dispatchEvent("cskill_load",this)
|
||||
|
||||
}
|
||||
|
||||
skill_init(uuid:number=1001,node:Node,pos:Vec3=v3(0,0,0)){
|
||||
var mv = node.getComponent(CSkillComp)
|
||||
mv.camp = 1;
|
||||
this.add(mv);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/** CSkill 模块业务逻辑系统组件,如无业务逻辑处理可删除此对象 */
|
||||
export class EcsCSkillSystem extends ecs.System {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
// this.add(new ecs.ComblockSystem());
|
||||
}
|
||||
}
|
||||
9
assets/script/game/monster/CSkill.ts.meta
Normal file
9
assets/script/game/monster/CSkill.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "430ee378-c69f-409a-b098-d3daec37d90b",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
51
assets/script/game/monster/CSkillComp.ts
Normal file
51
assets/script/game/monster/CSkillComp.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
import { _decorator } from "cc";
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||
import { Timer } from "../../../../extensions/oops-plugin-framework/assets/core/common/timer/Timer";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** 视图层对象 */
|
||||
@ccclass('CSkillComp')
|
||||
@ecs.register('CSkill', false)
|
||||
export class CSkillComp extends CCComp {
|
||||
//持续时间
|
||||
in_time: Timer = new Timer(5)
|
||||
is_destroy:boolean = false;
|
||||
camp:number = 1;
|
||||
/** 视图层逻辑代码分离演示 */
|
||||
start() {
|
||||
// var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
|
||||
// this.on(ModuleEvent.Cmd, this.onHandler, this);
|
||||
}
|
||||
protected update(dt: number): void {
|
||||
if (this.in_time.update(dt)) {
|
||||
if (this.is_destroy) {
|
||||
return
|
||||
}
|
||||
this.to_destroy()
|
||||
}
|
||||
}
|
||||
/** 全局消息逻辑处理 */
|
||||
// private onHandler(event: string, args: any) {
|
||||
// switch (event) {
|
||||
// case ModuleEvent.Cmd:
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
to_destroy() {
|
||||
this.is_destroy = true
|
||||
// console.log("CSkillComp toDestroy");
|
||||
if (this.node.isValid) {
|
||||
// console.log("CSkillComp.node.isValid");
|
||||
setTimeout(() => {
|
||||
// console.log("CSkillComp.node.destroy",this);
|
||||
this.node.destroy()
|
||||
}, 10);
|
||||
}
|
||||
}
|
||||
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||
reset() {
|
||||
this.node.destroy();
|
||||
}
|
||||
}
|
||||
9
assets/script/game/monster/CSkillComp.ts.meta
Normal file
9
assets/script/game/monster/CSkillComp.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "31174503-d934-4bd4-bd68-01aaa5534e81",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -14,23 +14,23 @@ import { smc } from "../common/SingletonModuleComp";
|
||||
import { MonsterModelComp } from "./MonsterModelComp";
|
||||
import { MonsterSpine } from "./MonsterSpine";
|
||||
import { MonsterViewComp } from "./MonsterViewComp";
|
||||
import {HeroModelComp} from "./HeroModelComp";
|
||||
import { CardSet } from "../common/config/CardSet";
|
||||
/** 角色实体 */
|
||||
@ecs.register(`Hero`)
|
||||
export class Hero extends ecs.Entity {
|
||||
// 数据层
|
||||
MonsterModel!: MonsterModelComp;
|
||||
HeroModel!: HeroModelComp;
|
||||
// 视图层
|
||||
MonsterView!: MonsterViewComp;
|
||||
|
||||
protected init() {
|
||||
this.addComponents<ecs.Comp>(
|
||||
MonsterModelComp);
|
||||
|
||||
this.addComponents<ecs.Comp>(HeroModelComp);
|
||||
}
|
||||
|
||||
destroy(): void {
|
||||
this.remove(MonsterViewComp);
|
||||
this.remove(MonsterModelComp);
|
||||
super.destroy();
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ export class Hero extends ecs.Entity {
|
||||
var node = instantiate(prefab);
|
||||
var scene = smc.map.MapView.scene;
|
||||
node.parent = scene.entityLayer!.node!;
|
||||
var as = node.getComponent(MonsterSpine);
|
||||
// var as = node.getComponent(MonsterSpine);
|
||||
|
||||
node.getChildByName("avatar").setScale(node.getChildByName("avatar").scale.x*camp, node.getChildByName("avatar").scale.y, node.getChildByName("avatar").scale.z);
|
||||
node.setPosition(pos)
|
||||
|
||||
@@ -6,6 +6,8 @@ import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/O
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
import { CardSet } from "../common/config/CardSet";
|
||||
import { HeroCard } from "./HeroCard";
|
||||
import { HeroModelComp } from "./HeroModelComp";
|
||||
import { Hero } from "./Hero";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** 视图层对象 */
|
||||
@@ -98,6 +100,13 @@ export class HeroCardViewComp extends CCComp {
|
||||
}
|
||||
|
||||
use_card(){
|
||||
Hero
|
||||
let heros = ecs.query(ecs.allOf(HeroModelComp))
|
||||
if(heros.length >= 4){
|
||||
oops.gui.toast("英雄数量达到上限");
|
||||
this.node.setPosition(this.pos_x,this.pos_y);
|
||||
return;
|
||||
}
|
||||
if(smc.vm_data.gold.min >= this.card_level){
|
||||
this.in_destroy = true;
|
||||
this.do_use_card()
|
||||
|
||||
26
assets/script/game/monster/HeroModelComp.ts
Normal file
26
assets/script/game/monster/HeroModelComp.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { VM } from "../../../../extensions/oops-plugin-framework/assets/libs/model-view/ViewModel";
|
||||
|
||||
/** 数据层对象 */
|
||||
@ecs.register('HeroModel')
|
||||
export class HeroModelComp extends ecs.Comp {
|
||||
/** 提供 MVVM 组件使用的数据 */
|
||||
// private vm: any = {};
|
||||
|
||||
// /** 显示数据添加到 MVVM 框架中监视 */
|
||||
// vmAdd() {
|
||||
// VM.add(this.vm, "HeroModelComp");
|
||||
// }
|
||||
|
||||
// /** 显示数据从 MVVM 框架中移除 */
|
||||
// vmRemove() {
|
||||
// VM.remove("HeroModelComp");
|
||||
// }
|
||||
|
||||
/** 数据层组件移除时,重置所有数据为默认值 */
|
||||
reset() {
|
||||
// for (var key in this.vm) {
|
||||
// delete this.vm[key];
|
||||
// }
|
||||
}
|
||||
}
|
||||
9
assets/script/game/monster/HeroModelComp.ts.meta
Normal file
9
assets/script/game/monster/HeroModelComp.ts.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "5e2825cf-c282-4297-be1f-631d2dc3bec5",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -52,7 +52,7 @@ export class MonsterViewComp extends CCComp {
|
||||
speed: number = 100; /** 角色移动速度 */
|
||||
ospeed: number = 100; /** 角色初始速度 */
|
||||
Tpos: Vec3 = v3(0,-60,0);
|
||||
stop_cd: number = 0; /*停止倒计时*/
|
||||
stop_cd: number = 0.5; /*停止倒计时*/
|
||||
|
||||
shield:number = 0; //护盾量
|
||||
shield_time:number = 0; //护盾持续时间
|
||||
@@ -139,12 +139,15 @@ export class MonsterViewComp extends CCComp {
|
||||
}
|
||||
|
||||
move(dt: number){
|
||||
if(this.stop_cd > 0){
|
||||
return
|
||||
}
|
||||
/**
|
||||
* 根据角色的阵营检查角色的 x 轴位置是否满足特定条件。
|
||||
* 如果角色属于正向阵营 (camp == 1) 且 x 轴位置大于等于 0,则直接返回。
|
||||
* 如果角色属于反向阵营 (camp != 1) 且 x 轴位置小于等于 0,则直接返回。
|
||||
*/
|
||||
if ((this.camp === 1 && this.node.position.x >= 180) || (this.camp !== 1 && this.node.position.x <= -180)) {
|
||||
if ((this.camp === 1 && this.node.position.x >= 0) || (this.camp !== 1 && this.node.position.x <= -180)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -191,7 +194,7 @@ export class MonsterViewComp extends CCComp {
|
||||
if(this.stop_cd > 0){
|
||||
this.stop_cd -= dt;
|
||||
if(this.stop_cd <= 0){
|
||||
this.speed = this.ospeed;
|
||||
// this.speed = this.ospeed;
|
||||
this.stop_cd = 0;
|
||||
}
|
||||
}
|
||||
@@ -223,7 +226,7 @@ export class MonsterViewComp extends CCComp {
|
||||
let pos = v3(this.camp*30,30)
|
||||
let speed =400
|
||||
let scale = this.camp
|
||||
let range = 360;
|
||||
let range = 120;
|
||||
skill.load(pos,speed,range,scale,this.node,skill_name,this.atk);
|
||||
}
|
||||
in_atked() {
|
||||
|
||||
@@ -38,7 +38,7 @@ export class RoleViewComp extends CCComp {
|
||||
skill_name: string = "base"; //技能名称
|
||||
max_skill_name: string = "base"; //大技能名称
|
||||
|
||||
atk: number = 10; /**攻击力 */
|
||||
atk: number = 2; /**攻击力 */
|
||||
// atk_speed: number = 1;
|
||||
atk_cd: number = 2; /**攻击速度 攻击间隔 */
|
||||
atk_time: number = 0; /** 冷却时间 */
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { BoxSet } from "../common/config/BoxSet";
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
import { SkillCom } from "./SkillCom";
|
||||
import { instantiate, Node, Prefab, Vec3 ,tween, v3,animation,Label,resources,SpriteFrame,Sprite} from "cc";
|
||||
|
||||
@@ -33,8 +34,9 @@ export class Skill extends ecs.Entity {
|
||||
var node = instantiate(prefab);
|
||||
node.parent = parent;
|
||||
node.setScale(scale,1)
|
||||
//转换pos为世界坐标
|
||||
node.setPosition(pos)
|
||||
|
||||
|
||||
var sv = node.getComponent(SkillCom)!;
|
||||
sv.speed = speed;
|
||||
sv.range = range;
|
||||
|
||||
@@ -2,6 +2,7 @@ import { _decorator,Collider2D ,Contact2DType,v3,IPhysics2DContact} from "cc";
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||
import { BoxSet } from "../common/config/BoxSet";
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -88,10 +89,16 @@ export class SkillCom extends CCComp {
|
||||
// }
|
||||
// }
|
||||
toDestroy() {
|
||||
// this.node.active = false;
|
||||
var scene = smc.map.MapView.scene;
|
||||
this.node.parent = scene.entityLayer!.node!;
|
||||
// console.log("toDestroy");
|
||||
if (this.node.isValid) {
|
||||
// console.log("this.node.isValid");
|
||||
setTimeout(() => {
|
||||
// console.log("SkillCom.node.destroy",this);
|
||||
this.ent.destroy()
|
||||
}, 15);
|
||||
}, 10);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user