英雄卡牌ui修改,todo 抽卡修改

This commit is contained in:
walkpan
2025-01-18 23:53:34 +08:00
parent 55061ec37c
commit cebf09a58c
16 changed files with 4544 additions and 1714 deletions

View File

@@ -1,4 +1,4 @@
import { _decorator, Color, Label, ProgressBar, Sprite } from "cc";
import { _decorator, Color, instantiate, Label, Prefab, ProgressBar, Sprite } 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 { HeroHomeComp } from "../map/HeroHomeComp";
@@ -41,7 +41,6 @@ export class HeroCardComp extends CCComp {
this.node.getChildByName("show").active=val
}
update_data(){
let slv = this.node.getChildByName("slv")
this.node.getChildByName("lv").getComponent(Label).string=smc.heros[this.h_uuid].lv.toString()+"级"
// if(smc.heros[this.h_uuid].slv==0){
@@ -70,14 +69,16 @@ export class HeroCardComp extends CCComp {
// break;
// }
}
/** 全局消息逻辑处理 */
// private onHandler(event: string, args: any) {
// switch (event) {
// case ModuleEvent.Cmd:
// break;
// }
// }
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("Mask")
}
clear_hero(){
this.node.getChildByName("Mask").destroyAllChildren()
}
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
reset() {
this.node.destroy();