清理之前文件 + 再次取消碰撞检测
This commit is contained in:
@@ -1,42 +0,0 @@
|
||||
import { _decorator,NodeEventType,EventTouch } 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 { UIID } from "../common/config/GameUIConfig";
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** 视图层对象 */
|
||||
@ccclass('CsuoComp')
|
||||
@ecs.register('Csuo', false)
|
||||
export class CsuoComp extends CCComp {
|
||||
|
||||
protected onLoad() {
|
||||
// this.node.on(NodeEventType.TOUCH_START, this.onTouch, this);
|
||||
|
||||
}
|
||||
onTouch() {
|
||||
|
||||
}
|
||||
onOk(){
|
||||
this.node.active=false;
|
||||
}
|
||||
oncancel(){
|
||||
|
||||
|
||||
}
|
||||
|
||||
/** 视图层逻辑代码分离演示 */
|
||||
start() {
|
||||
// var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
|
||||
// this.on(ModuleEvent.Cmd, this.onHandler, this);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||
reset() {
|
||||
this.node.destroy();
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "bcd8a069-5208-4be1-8c8e-2cedddb3860a",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -1,155 +0,0 @@
|
||||
import { _decorator,Button,color,EventHandler,EventTouch,instantiate,Label,NodeEventType,Prefab,ProgressBar,resources,Sprite,SpriteAtlas,tween,UITransform,v3 } 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 { HeroInfo, HeroList } from "../common/config/heroSet";
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
import { UIID } from "../common/config/GameUIConfig";
|
||||
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
||||
import { SkillSet } from "../common/config/SkillSet";
|
||||
import { getUpChipByLv, getUpGoldByRange, LvUp, SlvUp, UpGold } from "../common/config/RoleSet";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** 视图层对象 */
|
||||
@ccclass('HeroHomeComp')
|
||||
@ecs.register('HeroHome', false)
|
||||
export class HeroHomeComp extends CCComp {
|
||||
h_uuid:number=0
|
||||
role:any=null
|
||||
hero:any=null
|
||||
gold_need:number=9999
|
||||
chip_need:number=9999
|
||||
slv:number=0
|
||||
protected onLoad(): void {
|
||||
|
||||
}
|
||||
start() {
|
||||
// this.load_talents()
|
||||
console.log("hero_home start")
|
||||
// this.h_uuid=5001
|
||||
// this.hero_show(this.h_uuid)
|
||||
this.loads()
|
||||
this.node.getChildByName("show").active=false
|
||||
}
|
||||
loads(){
|
||||
let hc:number =HeroList.length
|
||||
let parent= this.node.getChildByName("heros").getChildByName("view").getChildByName("content")
|
||||
|
||||
parent.getComponent(UITransform).setContentSize(hc*185,230)
|
||||
// console.log("hc",hc,parent.getComponent(UITransform))
|
||||
console.log("parent",parent)
|
||||
|
||||
|
||||
}
|
||||
hero_show(uuid:number) {
|
||||
this.node.getChildByName("show").active=true
|
||||
this.h_uuid=uuid
|
||||
this.hero=HeroInfo[uuid]
|
||||
console.log("hero_show",uuid)
|
||||
// let skill1 = SkillSet[this.hero.skill[0]]
|
||||
// let skill2 = SkillSet[this.hero.skill[1]]
|
||||
// var sk_path = "game/skills/skill_icon"
|
||||
// var icon_path = "game/heros/herois"
|
||||
|
||||
|
||||
|
||||
let content=this.node.getChildByName("show").getChildByName("content")
|
||||
content.getChildByName("name").getChildByName("value").getComponent(Label).string=this.hero.name
|
||||
content.getChildByName("name").getChildByName("g1").active=HeroInfo[uuid].quality==1
|
||||
content.getChildByName("name").getChildByName("g2").active=HeroInfo[uuid].quality==2
|
||||
content.getChildByName("name").getChildByName("g3").active=HeroInfo[uuid].quality==3
|
||||
this.clear_hero()
|
||||
this.call_hero(uuid)
|
||||
// resources.load(icon_path, SpriteAtlas, (err: any, atlas) => {
|
||||
// const sprite = content.getChildByName("hero").getChildByName("icon").getComponent(Sprite);
|
||||
// sprite.spriteFrame = atlas.getSpriteFrame(this.hero.path);
|
||||
// });
|
||||
// resources.load(sk_path, SpriteAtlas, (err: any, atlas) => {
|
||||
// const sprite = content.getChildByName("bottom").getChildByName("sk").getChildByName("skicon").getChildByName("Mask").getChildByName("icon").getComponent(Sprite);
|
||||
// sprite.spriteFrame = atlas.getSpriteFrame(skill1.path);
|
||||
// });
|
||||
// content.getChildByName("bottom").getChildByName("sk").getChildByName("name").getComponent(Label).string = skill1.name;
|
||||
// content.getChildByName("bottom").getChildByName("sk").getChildByName("info").getComponent(Label).string = skill1.info;
|
||||
// resources.load(sk_path, SpriteAtlas, (err: any, atlas) => {
|
||||
// const sprite = content.getChildByName("bottom").getChildByName("sk2").getChildByName("skicon").getChildByName("Mask").getChildByName("icon").getComponent(Sprite);
|
||||
// sprite.spriteFrame = atlas.getSpriteFrame(skill2.path);
|
||||
// });
|
||||
// content.getChildByName("bottom").getChildByName("sk2").getChildByName("name").getComponent(Label).string = skill2.name;
|
||||
// content.getChildByName("bottom").getChildByName("sk2").getChildByName("info").getComponent(Label).string = skill2.info;
|
||||
|
||||
// tal.getChildByName("slv1").getChildByName("val").getComponent(Label).string = this.hero.tals[0]
|
||||
// tal.getChildByName("slv2").getChildByName("val").getComponent(Label).string = this.hero.tals[1]
|
||||
// tal.getChildByName("slv3").getChildByName("val").getComponent(Label).string = this.hero.tals[2]
|
||||
// tal.getChildByName("slv4").getChildByName("val").getComponent(Label).string = this.hero.tals[3]
|
||||
// tal.getChildByName("slv5").getChildByName("val").getComponent(Label).string = this.hero.tals[4]
|
||||
this.update_data()
|
||||
}
|
||||
update_data(){
|
||||
let content=this.node.getChildByName("show").getChildByName("content")
|
||||
// let slv_node=content.getChildByName("name").getChildByName("slv");
|
||||
// let slvup=content.getChildByName("slvup");
|
||||
let attr = content.getChildByName("attr");
|
||||
// slv_node.getChildByName("slv").getComponent(Label).string = smc.heros[uuid].slv.toString();
|
||||
// content.getChildByName("name").getChildByName("quality").getChildByName("q1").active = this.hero.quality == 1;
|
||||
// content.getChildByName("name").getChildByName("quality").getChildByName("q2").active = this.hero.quality == 2;
|
||||
// content.getChildByName("name").getChildByName("quality").getChildByName("q3").active = this.hero.quality == 3;
|
||||
// content.getChildByName("name").getChildByName("quality").getChildByName("k1").active = this.hero.kind == 1;
|
||||
// content.getChildByName("name").getChildByName("quality").getChildByName("k2").active = this.hero.kind == 2;
|
||||
// content.getChildByName("name").getChildByName("quality").getChildByName("k3").active = this.hero.kind == 3;
|
||||
// lvup.getChildByName("gold").getChildByName("need").getComponent(Label).string = (UpGold.LvUp*smc.heros[uuid].lv).toString()
|
||||
attr.getChildByName("ap").getChildByName("val").getComponent(Label).string = this.hero.ap.toFixed(0).toString()
|
||||
attr.getChildByName("hp").getChildByName("val").getComponent(Label).string = this.hero.hp.toFixed(0).toString()
|
||||
attr.getChildByName("acd").getChildByName("val").getComponent(Label).string = this.hero.a_cd
|
||||
attr.getChildByName("speed").getChildByName("val").getComponent(Label).string = this.hero.speed
|
||||
attr.getChildByName("dis").getChildByName("val").getComponent(Label).string = this.hero.dis
|
||||
|
||||
|
||||
|
||||
oops.message.dispatchEvent("hero_card_update_info",{uuid:this.h_uuid})
|
||||
}
|
||||
lv_selcet(e:any,val:any){
|
||||
|
||||
}
|
||||
|
||||
|
||||
call_hero(uuid:number){
|
||||
var path = "game/heros/uiheros/"+HeroInfo[uuid].path;
|
||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||
var node = instantiate(prefab);
|
||||
node.parent = this.node.getChildByName("show").getChildByName("content").getChildByName("hero").getChildByName("node")
|
||||
}
|
||||
clear_hero(){
|
||||
this.node.getChildByName("show").getChildByName("content").getChildByName("hero").getChildByName("node").destroyAllChildren()
|
||||
}
|
||||
pre_hero(){
|
||||
let hi= HeroList.indexOf(this.h_uuid)
|
||||
if(hi==0){
|
||||
oops.gui.toast("已经是第一个英雄");
|
||||
return
|
||||
}
|
||||
this.h_uuid=HeroList[hi-1]
|
||||
this.hero_show(this.h_uuid)
|
||||
}
|
||||
next_hero(){
|
||||
let hi= HeroList.indexOf(this.h_uuid)
|
||||
if(hi==HeroList.length-1){
|
||||
oops.gui.toast("已经是最后一个英雄");
|
||||
return
|
||||
}
|
||||
this.h_uuid=HeroList[hi+1]
|
||||
this.hero_show(this.h_uuid)
|
||||
}
|
||||
|
||||
|
||||
item_show(e:any,val:any){
|
||||
oops.gui.open(UIID.ItemInfo, {uuid:val,type:0});
|
||||
}
|
||||
close_show(){
|
||||
this.node.getChildByName("show").active=false
|
||||
}
|
||||
close(){
|
||||
this.node.active=false
|
||||
}
|
||||
reset() {
|
||||
this.node.destroy();
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
{"ver":"4.0.23","importer":"typescript","imported":true,"uuid":"f830455e-1cb8-4379-b382-6de74c383166","files":[],"subMetas":{},"userData":{}}
|
||||
@@ -1,142 +0,0 @@
|
||||
import { _decorator, instantiate, Prefab ,Node, Label, Sprite, resources, SpriteAtlas, v3} 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 { smc } from "../common/SingletonModuleComp";
|
||||
import { Item } from "./Item";
|
||||
import { Items } from "../common/config/Items";
|
||||
import { HChipComp } from "../hero/HChipComp";
|
||||
import { BoxDrop } from "../common/config/RewardSet";
|
||||
import { RandomManager } from "db://oops-framework/core/common/random/RandomManager";
|
||||
import { SChipComp } from "../hero/SChipComp";
|
||||
import { ItemComp } from "./ItemComp";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** 视图层对象 */
|
||||
@ccclass('LuckHomeCompComp')
|
||||
@ecs.register('LuckHomeComp', false)
|
||||
export class LuckHomeCompComp extends CCComp {
|
||||
@property({ type: Node })
|
||||
sbn: Node = null;
|
||||
@property({ type: Node })
|
||||
mbn: Node | null = null;
|
||||
@property({ type: Node })
|
||||
lbn: Node | null = null;
|
||||
@property({ type: Node })
|
||||
btnno: Node | null = null;
|
||||
@property({ type: Node })
|
||||
itmes: Node | null = null;
|
||||
selected: string = "";
|
||||
|
||||
/** 视图层逻辑代码分离演示 */
|
||||
start() {
|
||||
// var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
|
||||
// this.on(ModuleEvent.Cmd, this.onHandler, this);
|
||||
// this.frist();
|
||||
}
|
||||
frist(){
|
||||
this.colse_reward()
|
||||
}
|
||||
|
||||
open_sb() {
|
||||
smc.vmdata.box.num--;
|
||||
this.open_reward()
|
||||
this.get_reward(1)
|
||||
}
|
||||
open_mb() {
|
||||
if (smc.vmdata.box.num < 5) {oops.gui.toast("宝箱数量不足");return;}
|
||||
smc.vmdata.box.num=smc.vmdata.box.num-5;
|
||||
this.open_reward()
|
||||
for (let x = 0; x < 5; x++) {
|
||||
this.get_reward(2)
|
||||
}
|
||||
}
|
||||
open_lb() {
|
||||
if (smc.vmdata.box.num < 15) {oops.gui.toast("宝箱数量不足");return;}
|
||||
smc.vmdata.box.num=smc.vmdata.box.num-15;
|
||||
this.open_reward()
|
||||
for (let x = 0; x < 15; x++) {
|
||||
this.get_reward(2)
|
||||
}
|
||||
}
|
||||
colse_reward() {
|
||||
this.node.getChildByName("reward").setScale(0,0,0);
|
||||
this.node.getChildByName("reward").getChildByName("items").removeAllChildren();
|
||||
}
|
||||
open_reward() {
|
||||
this.node.getChildByName("reward").setScale(1,1,1);
|
||||
}
|
||||
get_reward(reward:number){
|
||||
console.log("get_reward",reward)
|
||||
let list =BoxDrop[reward];
|
||||
let uuid= 0
|
||||
let num =1
|
||||
let i=0
|
||||
while (uuid==0) {
|
||||
for (let x = 0; x < list.length; x++) {
|
||||
let rate = Math.random()*100
|
||||
if(rate < list[x].dropRate){
|
||||
uuid=list[x].uuid;
|
||||
num =RandomManager.instance.getRandomInt(list[x].num_max/2,list[x].num_max);
|
||||
break;
|
||||
}
|
||||
}
|
||||
i++;
|
||||
}
|
||||
switch(reward){
|
||||
|
||||
}
|
||||
}
|
||||
show_hero_chip(uuid:number,num:number){
|
||||
console.log("show_hero_chip",uuid,num)
|
||||
let path = "game/gui/hchip";
|
||||
let prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||
let node = instantiate(prefab);
|
||||
let hc= node.getComponent(HChipComp)
|
||||
hc.update_data(uuid,num)
|
||||
node.parent = this.node.getChildByName("reward").getChildByName("items");
|
||||
}
|
||||
show_item(uuid:number,num:number){
|
||||
var path = "game/gui/item";
|
||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||
var node = instantiate(prefab);
|
||||
let ic= node.getComponent(ItemComp)
|
||||
ic.update_data(uuid,num)
|
||||
node.parent = this.node.getChildByName("reward").getChildByName("items");
|
||||
|
||||
}
|
||||
show_skill_chip(uuid:number,num:number){
|
||||
let path = "game/gui/schip";
|
||||
let prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||
let node = instantiate(prefab);
|
||||
let sc= node.getComponent(SChipComp)
|
||||
sc.update_data(uuid,num)
|
||||
node.parent = this.node.getChildByName("reward").getChildByName("items");
|
||||
}
|
||||
show_bbox() {
|
||||
var parent = this.node.getChildByName("bbox")
|
||||
var path = "game/gui/bbox";
|
||||
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
||||
let box = instantiate(prefab);
|
||||
box.parent = parent;
|
||||
parent.getChildByName("light").active = true;
|
||||
this.scheduleOnce(()=>{
|
||||
parent.getChildByName("light").active = false;
|
||||
}, 0.5)
|
||||
this.scheduleOnce(()=>{
|
||||
box.destroy();
|
||||
}, 0.7)
|
||||
}
|
||||
to_open(){
|
||||
if(this.selected==""){return;}
|
||||
switch(this.selected){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||
reset() {
|
||||
this.node.destroy();
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "461697d5-ffa2-4577-8e33-2c329f3410b5",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
import { _decorator ,Vec3,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 { Timer } from "../../../../extensions/oops-plugin-framework/assets/core/common/timer/Timer";
|
||||
import { BoxSet, GameSet } 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, BossList } from "../common/config/MissionSet";
|
||||
import { RandomManager } from "../../../../extensions/oops-plugin-framework/assets/core/common/random/RandomManager";
|
||||
import { Hero } from "../hero/Hero";
|
||||
import { HeroModelComp } from "../hero/HeroModelComp";
|
||||
import { Boss} from "../Boss/Boss";
|
||||
import { UIID } from "../common/config/GameUIConfig";
|
||||
import { Talents } from "../common/config/TalentSet";
|
||||
import { HeroViewComp } from "../hero/HeroViewComp";
|
||||
import { HeroSet } from "../common/config/heroSet";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** 视图层对象 */
|
||||
@ccclass('MapMonsterComp')
|
||||
@ecs.register('MapMonster', false)
|
||||
export class MapMonsterComp extends CCComp {
|
||||
|
||||
|
||||
onLoad(){
|
||||
// 监听全局事件
|
||||
|
||||
|
||||
}
|
||||
start() {
|
||||
|
||||
}
|
||||
|
||||
protected update(dt: number): void {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/** 视图层逻辑代码分离演示 */
|
||||
|
||||
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||
reset() {
|
||||
this.node.destroy();
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "c0f2f76a-7c1b-4e8c-a0a3-b201f5a86f7e",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
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 { smc } from "../common/SingletonModuleComp";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** 视图层对象 */
|
||||
@ccclass('MapSkillComp')
|
||||
@ecs.register('MapSkill', false)
|
||||
export class MapSkillComp extends CCComp {
|
||||
// scene: MapViewScene = null;
|
||||
@property(Prefab)
|
||||
light: Prefab = null;
|
||||
onLoad(){
|
||||
oops.message.on("monster_load", this.doMonsterLoad, this);
|
||||
oops.message.on("hero_load", this.doHeroLoad, this);
|
||||
oops.message.on("do_use_skill", this.doSkill, this);
|
||||
oops.message.on("do_use_item", this.useItem, this);
|
||||
}
|
||||
doSkill(event: string, args: any){
|
||||
this.addCSkill(args.uuid);
|
||||
}
|
||||
addSkill(){
|
||||
|
||||
}
|
||||
addCSkill(uuid:number=1001,args:any=null){
|
||||
|
||||
}
|
||||
doMonsterLoad(){
|
||||
// const light = instantiate(this.light);
|
||||
// light.setPosition(BoxSet.MONSTER_START,BoxSet.GAME_LINE);
|
||||
// this.node.addChild(light);
|
||||
}
|
||||
doHeroLoad(){
|
||||
// const light = instantiate(this.light);
|
||||
// light.setPosition(BoxSet.HERO_START,BoxSet.GAME_LINE,0);
|
||||
// this.node.addChild(light);
|
||||
}
|
||||
useItem(event: string, args: any){
|
||||
console.log("useItem");
|
||||
|
||||
}
|
||||
/** 视图层逻辑代码分离演示 */
|
||||
start() {
|
||||
// var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
|
||||
// this.on(ModuleEvent.Cmd, this.onHandler, this);
|
||||
}
|
||||
|
||||
/** 全局消息逻辑处理 */
|
||||
// private onHandler(event: string, args: any) {
|
||||
// switch (event) {
|
||||
// case ModuleEvent.Cmd:
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||
reset() {
|
||||
this.node.destroy();
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "b7739951-194b-4d13-8bff-cd7f7a0b3bbf",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -17,10 +17,10 @@ const { ccclass, property } = _decorator;
|
||||
export class MissionHeroCompComp extends CCComp {
|
||||
timer:Timer=new Timer(2)
|
||||
onLoad(){
|
||||
// this.on(GameEvent.UserHeroCard,this.call_hero,this)
|
||||
this.on(GameEvent.UserHeroCard,this.call_hero,this)
|
||||
}
|
||||
start() {
|
||||
this.test_call()
|
||||
// this.test_call()
|
||||
}
|
||||
protected update(dt: number): void {
|
||||
if(smc.mission.status != 1) return
|
||||
|
||||
@@ -7,6 +7,7 @@ import { HeroSet } from "../common/config/heroSet";
|
||||
import { Missions } from "../common/config/MissionSet";
|
||||
import { RandomManager } from "db://oops-framework/core/common/random/RandomManager";
|
||||
import { Timer } from "db://oops-framework/core/common/timer/Timer";
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -19,12 +20,14 @@ export class MissionMonCompComp extends CCComp {
|
||||
start() {
|
||||
// var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
|
||||
// this.on(ModuleEvent.Cmd, this.onHandler, this);
|
||||
this.test_call()
|
||||
// this.test_call()
|
||||
}
|
||||
protected update(dt: number): void {
|
||||
// if(this.timer.update(dt)){
|
||||
// this.mon_refresh()
|
||||
// }
|
||||
if(!smc.mission.play||smc.mission.pause) return
|
||||
if(this.timer.update(dt)){
|
||||
this.mon_refresh()
|
||||
}
|
||||
|
||||
}
|
||||
test_call(){
|
||||
this.addMonster(5202,0,true)
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
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 { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** 视图层对象 */
|
||||
@ccclass('RewardsComp')
|
||||
@ecs.register('Rewards', false)
|
||||
export class RewardsComp extends CCComp {
|
||||
reward_lv = 1;
|
||||
onLoad(){
|
||||
// 监听全局事件
|
||||
oops.message.on("do_reward", this.do_reward, this);
|
||||
}
|
||||
/** 视图层逻辑代码分离演示 */
|
||||
start() {
|
||||
// var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
|
||||
// this.on(ModuleEvent.Cmd, this.onHandler, this);
|
||||
}
|
||||
do_reward(){
|
||||
this.node.active = true;
|
||||
}
|
||||
/** 全局消息逻辑处理 */
|
||||
// private onHandler(event: string, args: any) {
|
||||
// switch (event) {
|
||||
// case ModuleEvent.Cmd:
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||
reset() {
|
||||
this.node.destroy();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "df8725c7-a5e8-4dfd-b357-59fb88b68283",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
import { _decorator, instantiate, Prefab, UITransform } 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 { UIID } from "../common/config/GameUIConfig";
|
||||
import { Items } from "../common/config/Items";
|
||||
import { Item } from "./Item";
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
import { RewardComp } from "./RewardComp";
|
||||
import { SChipComp } from "../hero/SChipComp";
|
||||
import { HChipComp } from "../hero/HChipComp";
|
||||
import { Goods } from "./Goods";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** 视图层对象 */
|
||||
@ccclass('ShopHomeComp')
|
||||
@ecs.register('ShopHomeComp', false)
|
||||
export class ShopHomeComp extends CCComp {
|
||||
/** 视图层逻辑代码分离演示 */
|
||||
start() {
|
||||
this.get_items();
|
||||
}
|
||||
get_items(){
|
||||
let goodsnode = this.node.getChildByName("goods").getChildByName("view").getChildByName("content")
|
||||
|
||||
}
|
||||
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||
reset() {
|
||||
this.node.destroy();
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "08123a0b-18dd-4dcb-8f8b-17664ff1ec67",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
import { _decorator, UITransform } 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 { MSklist } from "../common/config/SkillSet";
|
||||
import { MSCard } from "./MSCard";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** 视图层对象 */
|
||||
@ccclass('SkillHomeComp')
|
||||
@ecs.register('SkillHome', false)
|
||||
export class SkillHomeComp extends CCComp {
|
||||
/** 视图层逻辑代码分离演示 */
|
||||
start() {
|
||||
// var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
|
||||
// this.on(ModuleEvent.Cmd, this.onHandler, this);
|
||||
this.load_skill_card()
|
||||
}
|
||||
|
||||
load_skill_card(){
|
||||
let ms_num:number =MSklist.length
|
||||
let parent= this.node.getChildByName("skills").getChildByName("view").getChildByName("content")
|
||||
let height=ms_num*135
|
||||
parent.getComponent(UITransform).height=height
|
||||
for (let i = 0; i < ms_num; i++) {
|
||||
let msc =ecs.getEntity<MSCard>(MSCard)
|
||||
msc.load(MSklist[i],parent,1)
|
||||
}
|
||||
}
|
||||
|
||||
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||
reset() {
|
||||
this.node.destroy();
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "cf5847e5-a4d7-4a84-8064-024371ea2125",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
import { _decorator, Component, Node ,director,game} from 'cc';
|
||||
import { oops } from '../../../../extensions/oops-plugin-framework/assets/core/Oops';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('unlock')
|
||||
export class unlockComp extends Component {
|
||||
start() {
|
||||
|
||||
}
|
||||
|
||||
doCancel() {
|
||||
this.node.active = false
|
||||
|
||||
}
|
||||
doActive() {
|
||||
this.node.active = true
|
||||
|
||||
}
|
||||
update(deltaTime: number) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "3a67f9d9-8df3-4cfc-955d-1a8b1c30b2e8",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
Reference in New Issue
Block a user