英雄页面基本完成,todo 完善 数据显示
This commit is contained in:
@@ -2,6 +2,7 @@ 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 { HeroHomeComp } from "../map/HeroHomeComp";
|
||||
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -12,7 +13,9 @@ export class HeroCardComp extends CCComp {
|
||||
@property(HeroHomeComp)
|
||||
hcc_home: HeroHomeComp = null!;
|
||||
hcc_uuid: number = 0;
|
||||
|
||||
onLoad() {
|
||||
oops.message.on("hero_card_show_info", this.check_show, this);
|
||||
}
|
||||
/** 视图层逻辑代码分离演示 */
|
||||
start() {
|
||||
this.hcc_home=this.node.parent.parent.parent.parent.getComponent(HeroHomeComp);
|
||||
@@ -21,6 +24,16 @@ export class HeroCardComp extends CCComp {
|
||||
}
|
||||
show_info(){
|
||||
this.hcc_home.hero_show(this.hcc_uuid)
|
||||
oops.message.dispatchEvent("hero_card_show_info",{uuid:this.hcc_uuid})
|
||||
}
|
||||
check_show(event: string, args: any){
|
||||
this.show_bg(false)
|
||||
if(args.uuid==this.hcc_uuid){
|
||||
this.show_bg(true)
|
||||
}
|
||||
}
|
||||
show_bg(val:boolean){
|
||||
this.node.getChildByName("show").active=val
|
||||
}
|
||||
/** 全局消息逻辑处理 */
|
||||
// private onHandler(event: string, args: any) {
|
||||
|
||||
Reference in New Issue
Block a user