This commit is contained in:
2024-11-28 08:43:04 +08:00
parent 4ba91e95fa
commit ce0a88988b
6 changed files with 1368 additions and 1397 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -2,7 +2,7 @@
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "9851f9ee-65d3-42c9-8d06-2e1eaf0b8301",
"uuid": "d339f36c-b865-4989-8f32-cea0584275f2",
"files": [
".json"
],

File diff suppressed because it is too large Load Diff

View File

@@ -16,6 +16,8 @@ export enum UIID {
Netinstable,
/** 角色控制 */
Role_Controller,
/**物品 */
ItemInfo
}
/** 打开界面方式的配置数据 */
@@ -24,4 +26,5 @@ export var UIConfigData: { [key: number]: UIConfig } = {
[UIID.Netinstable]: { layer: LayerType.PopUp, prefab: "common/prefab/netinstable" },
[UIID.Window]: { layer: LayerType.Dialog, prefab: "common/prefab/window" },
[UIID.Role_Controller]: { layer: LayerType.UI, prefab: "gui/role_controller" },
[UIID.ItemInfo]: { layer: LayerType.UI, prefab: "gui/element/item_info" },
}

View File

@@ -1,29 +1,45 @@
import { _decorator } from "cc";
import { EventTouch, Node,_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 { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
import { UIID } from "../common/config/GameUIConfig";
const { ccclass, property } = _decorator;
/** 视图层对象 */
@ccclass('ItemInfoComp')
@ecs.register('ItemInfo', false)
export class ItemInfoComp extends CCComp {
/** 视图层逻辑代码分离演示 */
start() {
// var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
// this.on(ModuleEvent.Cmd, this.onHandler, this);
onAdded(args: any) {
console.log("args");
}
/** 全局消息逻辑处理 */
// private onHandler(event: string, args: any) {
// switch (event) {
// case ModuleEvent.Cmd:
// break;
// }
// }
onLoad() {
this.node.on(Node.EventType.TOUCH_END, this.onTouchEnd, this);
}
private onTouchEnd(event: EventTouch) {
switch (event.target.name) {
case "btn_levelup":
this.ent.remove(ItemInfoComp);
break;
case "btn_close":
this.ent.remove(ItemInfoComp);
break;
}
event.propagationStopped = true;
}
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
reset() {
this.node.destroy();
oops.gui.remove(UIID.ItemInfo, false);
// 注:模拟二次删除清理缓存
setTimeout(() => {
oops.gui.remove(UIID.ItemInfo);
}, 1000);
}
protected onDestroy(): void {
console.log("释放角色信息界面");
}
}

View File

@@ -9,6 +9,8 @@ import { RandomManager } from "../../../../extensions/oops-plugin-framework/asse
import { MissionReward } from "../common/config/MissionSet";
import { Items } from "../common/config/Items";
import { Item } from "./Item";
import { UIID } from "../common/config/GameUIConfig";
import { PopViewParams, UICallbacks } from "../../../../extensions/oops-plugin-framework/assets/core/gui/layer/Defines";
const { ccclass, property } = _decorator;
@@ -56,6 +58,14 @@ export class VictoryComp extends CCComp {
end_mission(){
this.node.getChildByName("Node").setScale(0,0,0)
this.if_show=false
let args:any ={
uuid:1001,
name:"普通攻击石",
info:"一星英雄升星",
num:1
}
}