From 85d9e7c55acfcf216d8fecbd6042d1febda7b93d Mon Sep 17 00:00:00 2001 From: panw Date: Thu, 2 Apr 2026 09:46:56 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E6=8E=92=E8=A1=8C?= =?UTF-8?q?=E6=A6=9CUI=E7=95=8C=E9=9D=A2=E5=92=8C=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加 RanksComp 组件用于实现排行榜功能 - 在 GameUIConfig 中注册排行榜界面配置 - 创建排行榜界面元数据文件 --- .../script/game/common/config/GameUIConfig.ts | 2 + assets/script/game/map/RanksComp.ts | 46 +++++++++++++++++++ assets/script/game/map/RanksComp.ts.meta | 9 ++++ 3 files changed, 57 insertions(+) create mode 100644 assets/script/game/map/RanksComp.ts create mode 100644 assets/script/game/map/RanksComp.ts.meta diff --git a/assets/script/game/common/config/GameUIConfig.ts b/assets/script/game/common/config/GameUIConfig.ts index fe98e21c..47729d57 100644 --- a/assets/script/game/common/config/GameUIConfig.ts +++ b/assets/script/game/common/config/GameUIConfig.ts @@ -17,6 +17,7 @@ export enum UIID { Victory, IBox, Notity, + Ranks, } /** 打开界面方式的配置数据 */ @@ -27,4 +28,5 @@ export var UIConfigData: { [key: number]: UIConfig } = { [UIID.Victory]: { layer: LayerType.UI, prefab: "gui/element/victory" }, [UIID.IBox]: { layer: LayerType.UI, prefab: "gui/element/ibox" }, [UIID.Notity]: { layer: LayerType.UI, prefab: "gui/element/notity" }, + [UIID.Ranks]: { layer: LayerType.UI, prefab: "gui/element/ranks" }, } \ No newline at end of file diff --git a/assets/script/game/map/RanksComp.ts b/assets/script/game/map/RanksComp.ts new file mode 100644 index 00000000..e60586a6 --- /dev/null +++ b/assets/script/game/map/RanksComp.ts @@ -0,0 +1,46 @@ +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() { + + } + + + /** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */ + reset() { + + this.node.destroy(); + } +} diff --git a/assets/script/game/map/RanksComp.ts.meta b/assets/script/game/map/RanksComp.ts.meta new file mode 100644 index 00000000..27e23a8d --- /dev/null +++ b/assets/script/game/map/RanksComp.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "4.0.24", + "importer": "typescript", + "imported": true, + "uuid": "9eafe7fe-fbde-4312-a07b-f2130f0a6539", + "files": [], + "subMetas": {}, + "userData": {} +}