英雄展示页面++
This commit is contained in:
@@ -2225,7 +2225,7 @@
|
|||||||
},
|
},
|
||||||
"_lpos": {
|
"_lpos": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
"x": 73,
|
"x": 100,
|
||||||
"y": -72.8,
|
"y": -72.8,
|
||||||
"z": 0
|
"z": 0
|
||||||
},
|
},
|
||||||
@@ -2266,12 +2266,12 @@
|
|||||||
},
|
},
|
||||||
"_contentSize": {
|
"_contentSize": {
|
||||||
"__type__": "cc.Size",
|
"__type__": "cc.Size",
|
||||||
"width": 54,
|
"width": 92.95263671875,
|
||||||
"height": 54.4
|
"height": 54.4
|
||||||
},
|
},
|
||||||
"_anchorPoint": {
|
"_anchorPoint": {
|
||||||
"__type__": "cc.Vec2",
|
"__type__": "cc.Vec2",
|
||||||
"x": 0.5,
|
"x": 1,
|
||||||
"y": 0.5
|
"y": 0.5
|
||||||
},
|
},
|
||||||
"_id": ""
|
"_id": ""
|
||||||
@@ -2302,8 +2302,8 @@
|
|||||||
"b": 255,
|
"b": 255,
|
||||||
"a": 255
|
"a": 255
|
||||||
},
|
},
|
||||||
"_string": "名称",
|
"_string": "名称111",
|
||||||
"_horizontalAlign": 1,
|
"_horizontalAlign": 2,
|
||||||
"_verticalAlign": 1,
|
"_verticalAlign": 1,
|
||||||
"_actualFontSize": 25,
|
"_actualFontSize": 25,
|
||||||
"_fontSize": 25,
|
"_fontSize": 25,
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -37,9 +37,9 @@ export class SingletonModuleComp extends ecs.Comp {
|
|||||||
4:0,
|
4:0,
|
||||||
}
|
}
|
||||||
heros:any = {
|
heros:any = {
|
||||||
5001:{lv:1},
|
5001:{uuid:5001,lv:1,slv:0},
|
||||||
5005:{lv:1},
|
5005:{uuid:5005,lv:1,slv:0},
|
||||||
5007:{lv:1},
|
5007:{uuid:5007,lv:1,slv:0},
|
||||||
};
|
};
|
||||||
|
|
||||||
monsters:any = [];
|
monsters:any = [];
|
||||||
@@ -312,7 +312,9 @@ export class SingletonModuleComp extends ecs.Comp {
|
|||||||
this.setHeroProperty(heroId, "lv", newLevel, autoSave);
|
this.setHeroProperty(heroId, "lv", newLevel, autoSave);
|
||||||
console.log(`[SMC]: 英雄${heroId}升级: ${currentLevel} -> ${newLevel}`);
|
console.log(`[SMC]: 英雄${heroId}升级: ${currentLevel} -> ${newLevel}`);
|
||||||
}
|
}
|
||||||
|
getHasHeroUUID() {
|
||||||
|
return Object.keys(this.heros).map(Number)
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 获取英雄等级
|
* 获取英雄等级
|
||||||
* @param heroId 英雄ID
|
* @param heroId 英雄ID
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ export const MonSet = {
|
|||||||
|
|
||||||
export const HeroInfo = {
|
export const HeroInfo = {
|
||||||
//主将
|
//主将
|
||||||
5001:{uuid:5001,name:"火焰骑士",path:"hk1", fac:FacSet.HERO, quality:HQuality.BLUE,lv:1,kind:1,
|
5001:{uuid:5001,name:"火焰骑士",path:"hk1", fac:FacSet.HERO, quality:HQuality.GREEN,lv:1,kind:1,
|
||||||
type:HType.warrior,hp:100,ap:15,dis:100,cd:1,speed:150,skills:[6011,6020],
|
type:HType.warrior,hp:100,ap:15,dis:100,cd:1,speed:150,skills:[6011,6020],
|
||||||
buff:[],info:"剑类专精,穿刺伤害额外+10%"},
|
buff:[],info:"剑类专精,穿刺伤害额外+10%"},
|
||||||
|
|
||||||
@@ -92,7 +92,7 @@ export const HeroInfo = {
|
|||||||
buff:[],info:"说明"},
|
buff:[],info:"说明"},
|
||||||
|
|
||||||
|
|
||||||
5007:{uuid:5007,name:"mh1",path:"hmh1", fac:FacSet.HERO, quality:HQuality.BLUE,lv:1,kind:2,
|
5007:{uuid:5007,name:"mh1",path:"hmh1", fac:FacSet.HERO, quality:HQuality.PURPLE,lv:1,kind:2,
|
||||||
type:HType.mage,hp:100,ap:15,dis:400,cd:1,speed:100,skills:[6002,6002],
|
type:HType.mage,hp:100,ap:15,dis:400,cd:1,speed:100,skills:[6002,6002],
|
||||||
buff:[],info:"说明"},
|
buff:[],info:"说明"},
|
||||||
|
|
||||||
|
|||||||
@@ -7,13 +7,14 @@ const { ccclass, property } = _decorator;
|
|||||||
export class HCardUICom extends Component {
|
export class HCardUICom extends Component {
|
||||||
h_uuid:number=0
|
h_uuid:number=0
|
||||||
start() {
|
start() {
|
||||||
|
console.log("[HCardUICom]:start")
|
||||||
}
|
}
|
||||||
|
|
||||||
update(deltaTime: number) {
|
update(deltaTime: number) {
|
||||||
|
|
||||||
}
|
}
|
||||||
update_data(uuid:number){
|
update_data(uuid:number){
|
||||||
|
console.log("[HCardUICom]:update_data",uuid)
|
||||||
this.h_uuid=uuid
|
this.h_uuid=uuid
|
||||||
let hero_data = HeroInfo[uuid]
|
let hero_data = HeroInfo[uuid]
|
||||||
let hero= this.node.getChildByName("hero")
|
let hero= this.node.getChildByName("hero")
|
||||||
|
|||||||
@@ -1,14 +1,52 @@
|
|||||||
import { _decorator, Component, Node } from 'cc';
|
import { _decorator, Component, instantiate, Node, Prefab } from 'cc';
|
||||||
const { ccclass, property } = _decorator;
|
import { smc } from '../common/SingletonModuleComp';
|
||||||
|
import { oops } from 'db://oops-framework/core/Oops';
|
||||||
@ccclass('HeroPageComp')
|
import { HCardUICom } from './HCardUICom';
|
||||||
export class HeroPageComp extends Component {
|
const { ccclass, property } = _decorator;
|
||||||
start() {
|
|
||||||
|
@ccclass('HeroPageComp')
|
||||||
}
|
export class HeroPageComp extends Component {
|
||||||
|
start() {
|
||||||
update(deltaTime: number) {
|
console.log("[HeroPageComp]:start")
|
||||||
|
}
|
||||||
}
|
|
||||||
}
|
update(deltaTime: number) {
|
||||||
|
|
||||||
|
}
|
||||||
|
update_heros(){
|
||||||
|
let heros=smc.getHasHeroUUID()
|
||||||
|
console.log("[HeroPageComp]:update_heros",heros)
|
||||||
|
this.clear_heros()
|
||||||
|
for(let i=0;i<3;i++){
|
||||||
|
let hero=heros[i]
|
||||||
|
console.log("[HeroPageComp]:hero",hero)
|
||||||
|
if(hero){
|
||||||
|
this.load_hero(hero)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
load_hero(uuid:number){
|
||||||
|
console.log("[HeroPageComp]:load_hero",uuid)
|
||||||
|
let parent=this.node.getChildByName("main").getChildByName("view").getChildByName("heros")
|
||||||
|
let path = "game/gui/hcard"
|
||||||
|
const prefab = oops.res.get(path, Prefab);
|
||||||
|
if (!prefab) {
|
||||||
|
console.error("[Skill] 预制体加载失败:", path);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const node = instantiate(prefab);
|
||||||
|
node.parent=parent
|
||||||
|
let hcard=node.getComponent(HCardUICom)!
|
||||||
|
hcard.update_data(uuid)
|
||||||
|
}
|
||||||
|
clear_heros(){
|
||||||
|
let parent=this.node.getChildByName("main").getChildByName("view").getChildByName("heros")
|
||||||
|
let children=parent.children
|
||||||
|
console.log("[HeroPageComp]:clear_heros",children)
|
||||||
|
for(let i=0;i<children.length;i++){
|
||||||
|
children[i].destroy()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/modu
|
|||||||
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
||||||
import { smc } from "../common/SingletonModuleComp";
|
import { smc } from "../common/SingletonModuleComp";
|
||||||
import { GameEvent } from "../common/config/GameEvent";
|
import { GameEvent } from "../common/config/GameEvent";
|
||||||
|
import { HeroPageComp } from "./HeroPageComp";
|
||||||
|
|
||||||
const { ccclass, property } = _decorator;
|
const { ccclass, property } = _decorator;
|
||||||
|
|
||||||
@@ -38,10 +39,11 @@ export class MissionHomeComp extends CCComp {
|
|||||||
smc.syncData()
|
smc.syncData()
|
||||||
}
|
}
|
||||||
btn_func(e:string,data:any){
|
btn_func(e:string,data:any){
|
||||||
console.log("[MissionHomeComp]:btn_func",e,data)
|
// console.log("[MissionHomeComp]:btn_func",e,data)
|
||||||
let btns=this.node.getChildByName("btns")
|
let btns=this.node.getChildByName("btns")
|
||||||
let shop =btns.getChildByName("shop")
|
let shop =btns.getChildByName("shop")
|
||||||
let heros =btns.getChildByName("heros")
|
let heros =btns.getChildByName("heros")
|
||||||
|
let heros_page=this.node.getChildByName("heros").getComponent(HeroPageComp)!
|
||||||
let fight =btns.getChildByName("fight")
|
let fight =btns.getChildByName("fight")
|
||||||
let skill =btns.getChildByName("skill")
|
let skill =btns.getChildByName("skill")
|
||||||
let set =btns.getChildByName("set")
|
let set =btns.getChildByName("set")
|
||||||
@@ -62,6 +64,7 @@ export class MissionHomeComp extends CCComp {
|
|||||||
break
|
break
|
||||||
case "heros":
|
case "heros":
|
||||||
this.node.getChildByName("heros").active=true
|
this.node.getChildByName("heros").active=true
|
||||||
|
heros_page.update_heros()
|
||||||
heros.getChildByName("act").active=true
|
heros.getChildByName("act").active=true
|
||||||
break
|
break
|
||||||
case "fight":
|
case "fight":
|
||||||
|
|||||||
Reference in New Issue
Block a user