feat(地图): 新增英雄列表组件并扩展主页组件属性
- 添加 HlistComp 组件用于展示英雄列表,包含英雄图标、属性显示及翻页按钮 - 在 MissionHomeComp 中增加页面节点和按钮的引用属性,为页面切换功能做准备
This commit is contained in:
File diff suppressed because it is too large
Load Diff
42
assets/script/game/map/HlistComp.ts
Normal file
42
assets/script/game/map/HlistComp.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import { _decorator, Animation, AnimationClip, Button, Event, Label, Node, NodeEventType, Sprite, resources } 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('HListComp')
|
||||
@ecs.register('HListComp', false)
|
||||
export class HListComp extends CCComp {
|
||||
@property(Node)
|
||||
hero_icon=null!
|
||||
@property(Node)
|
||||
ap_node=null!
|
||||
@property(Node)
|
||||
hp_node=null!
|
||||
@property(Node)
|
||||
info_node=null!
|
||||
@property(Node)
|
||||
name_node=null!
|
||||
|
||||
@property(Node)
|
||||
pre_btn=null!
|
||||
@property(Node)
|
||||
next_btn=null!
|
||||
huuid:number=null!
|
||||
onLoad() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
|
||||
reset() {
|
||||
this.node.destroy();
|
||||
}
|
||||
}
|
||||
1
assets/script/game/map/HlistComp.ts.meta
Normal file
1
assets/script/game/map/HlistComp.ts.meta
Normal file
@@ -0,0 +1 @@
|
||||
{"ver":"4.0.24","importer":"typescript","imported":true,"uuid":"89bf6d65-5432-4946-9b14-3e5150dddedd","files":[],"subMetas":{},"userData":{}}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { _decorator, instantiate, Prefab, resources, Sprite, SpriteAtlas, UITransform } from "cc";
|
||||
import { _decorator, instantiate, Prefab, resources, Sprite, SpriteAtlas, UITransform ,Node} 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 { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
||||
@@ -15,6 +15,19 @@ const { ccclass, property } = _decorator;
|
||||
export class MissionHomeComp extends CCComp {
|
||||
debugMode: boolean = false;
|
||||
|
||||
@property(Node)
|
||||
heros_page=null!
|
||||
@property(Node)
|
||||
rank_page=null!
|
||||
|
||||
@property(Node)
|
||||
home_btn=null!
|
||||
@property(Node)
|
||||
hero_btn=null!
|
||||
@property(Node)
|
||||
rank_btn=null!
|
||||
|
||||
|
||||
protected onLoad(): void {
|
||||
this.on(GameEvent.MissionEnd,this.mission_end,this)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user