- 在 MissionHomeComp 中添加 openRanks 方法以打开排行榜界面 - 在 RanksComp 中添加 closeRanks 方法以关闭排行榜界面 - 调整 ranks.prefab 布局并添加关闭按钮的事件绑定 - 移除 MissionHomeComp 中未使用的页面节点引用和废弃代码
49 lines
1.3 KiB
TypeScript
49 lines
1.3 KiB
TypeScript
import { _decorator, Animation, AnimationClip, Button, Event, Label, Node, NodeEventType, Sprite, resources, Prefab } 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 } from "../common/config/heroSet";
|
|
import { HeroAttrsComp } from "../hero/HeroAttrsComp";
|
|
import { Hero } from "../hero/Hero";
|
|
import { oops } from "db://oops-framework/core/Oops";
|
|
import { UIID } from "../common/config/GameUIConfig";
|
|
import { mLogger } from "../common/Logger";
|
|
|
|
const {property, ccclass } = _decorator;
|
|
|
|
/** 视图层对象 */
|
|
@ccclass('RanksComp')
|
|
@ecs.register('RanksComp', false)
|
|
export class RanksComp extends CCComp {
|
|
@property(Node)
|
|
top1_node=null!
|
|
@property(Node)
|
|
top2_node=null!
|
|
@property(Node)
|
|
top3_node=null!
|
|
@property(Node)
|
|
lists_node=null!
|
|
@property(Prefab)
|
|
list_prefab=null!
|
|
@property(Prefab)
|
|
melist_prefab=null!
|
|
|
|
onLoad() {
|
|
|
|
}
|
|
onAdded(args: any) {
|
|
|
|
}
|
|
onDestroy() {
|
|
|
|
}
|
|
closeRanks(){
|
|
oops.gui.remove(UIID.Ranks)
|
|
}
|
|
|
|
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
|
reset() {
|
|
|
|
this.node.destroy();
|
|
}
|
|
}
|