Przeglądaj źródła

添加关于我们场景和逻辑

mojunshou 8 miesięcy temu
rodzic
commit
b399992af4

Plik diff jest za duży
+ 2021 - 0
assets/bundle/common/prefab/about.prefab


+ 13 - 0
assets/bundle/common/prefab/about.prefab.meta

@@ -0,0 +1,13 @@
+{
+  "ver": "1.1.50",
+  "importer": "prefab",
+  "imported": true,
+  "uuid": "cd88cf64-002d-48c2-a21d-1f1fd7dd3d1e",
+  "files": [
+    ".json"
+  ],
+  "subMetas": {},
+  "userData": {
+    "syncNodeName": "about"
+  }
+}

+ 2 - 2
assets/bundle/common/prefab/setting.prefab

@@ -1101,7 +1101,7 @@
   },
   {
     "__type__": "cc.Node",
-    "_name": "lab_name",
+    "_name": "lab_nickName",
     "_objFlags": 0,
     "__editorExtras__": {},
     "_parent": {
@@ -4123,7 +4123,7 @@
       "b": 255,
       "a": 255
     },
-    "_string": "隐私协议",
+    "_string": "关于我们",
     "_horizontalAlign": 1,
     "_verticalAlign": 1,
     "_actualFontSize": 20,

+ 4 - 1
assets/resources/config.json

@@ -12,7 +12,10 @@
         "webSocketProt": "8081",
         "webSocketHeartTime": 6000,
         "webSocketReceiveTime": 10000,
-        "webSocketReconnetTimeOut": 3000
+        "webSocketReconnetTimeOut": 3000,
+        "gameName": "消消乐",
+        "gameVersion": "1.0.5",
+        "gameCompanyName": "广州市游戏科技有限公司"
     },
     "language": {
         "default": "zh",

+ 9 - 0
assets/script/game/common/about.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.2.0",
+  "importer": "directory",
+  "imported": true,
+  "uuid": "e7b6c405-d241-4329-8fd7-2574c404972d",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 40 - 0
assets/script/game/common/about/AboutViewComp.ts

@@ -0,0 +1,40 @@
+import { _decorator } from "cc";
+import { oops } from "db://oops-framework/core/Oops";
+import { ecs } from "db://oops-framework/libs/ecs/ECS";
+import { CCComp } from "db://oops-framework/module/common/CCComp";
+import { UIID } from "../config/GameUIConfig";
+import { CCVMParentComp } from "db://oops-framework/module/common/CCVMParentComp";
+
+const { ccclass, property } = _decorator;
+
+/** 视图层对象 */
+@ccclass('AboutViewComp')
+@ecs.register('AboutView', false)
+export class aboutViewComp extends CCVMParentComp {
+    data: any = {
+        gameName: "",
+        version: "",
+        companyName: "",
+    }
+
+
+
+    /** 视图层逻辑代码分离演示 */
+    start() {
+        // const entity = this.ent as ecs.Entity;         // ecs.Entity 可转为当前模块的具体实体对象
+        this.setButton();
+        this.data.gameName = oops.config.game.gameName;
+        this.data.version = oops.config.game.gameVersion;
+        this.data.companyName = oops.config.game.gameCompanyName;
+    }
+
+    /** 视图对象通过 ecs.Entity.remove(aboutUsViewComp) 删除组件是触发组件处理自定义释放逻辑 */
+    reset() {
+        this.node.destroy();
+    }
+
+
+    btn_back() {
+        oops.gui.remove(UIID.AboutUs);
+    }
+}

+ 9 - 0
assets/script/game/common/about/AboutViewComp.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.24",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "b0d8b035-6e5b-4249-bb7e-98d4fff784c4",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 9 - 3
assets/script/game/common/config/GameUIConfig.ts

@@ -1,7 +1,7 @@
 /*
  * @Date: 2021-08-12 09:33:37
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-03-20 15:03:33
+ * @LastEditTime: 2025-03-20 15:56:24
  */
 import { LayerType, UIConfig } from "../../../../../extensions/oops-plugin-framework/assets/core/gui/layer/LayerManager";
 
@@ -20,7 +20,11 @@ export enum UIID {
     /** 隐私挽留弹窗 */
     Retention,
     /** 消除游戏主场景 */
-    Eliminate
+    Eliminate,
+    /** 设置页面 */
+    Setting,
+    /** 关于我们页面 */
+    AboutUs
 
 }
 
@@ -32,5 +36,7 @@ export var UIConfigData: { [key: number]: UIConfig } = {
     [UIID.Demo]: { layer: LayerType.UI, prefab: "gui/demo/demo" },
     [UIID.KindTips]: { layer: LayerType.PopUp, prefab: "common/prefab/kind_tips" },
     [UIID.Retention]: { layer: LayerType.PopUp, prefab: "common/prefab/retention" },
-    [UIID.Eliminate]: { layer: LayerType.UI, prefab: "gui/eliminate/eliminate" }
+    [UIID.Eliminate]: { layer: LayerType.UI, prefab: "gui/eliminate/eliminate" },
+    [UIID.Setting]: { layer: LayerType.UI, prefab: "common/prefab/setting" },
+    [UIID.AboutUs]: { layer: LayerType.UI, prefab: "common/prefab/about" }
 }

+ 24 - 1
assets/script/game/common/setting/SettingViewComp.ts

@@ -1,20 +1,43 @@
 import { _decorator } from "cc";
+import { oops } from "db://oops-framework/core/Oops";
 import { ecs } from "db://oops-framework/libs/ecs/ECS";
 import { CCComp } from "db://oops-framework/module/common/CCComp";
+import { UIID } from "../config/GameUIConfig";
+import { CCVMParentComp } from "db://oops-framework/module/common/CCVMParentComp";
 
 const { ccclass, property } = _decorator;
 
 /** 视图层对象 */
 @ccclass('SettingViewComp')
 @ecs.register('SettingView', false)
-export class SettingViewComp extends CCComp {
+export class SettingViewComp extends CCVMParentComp {
+    data: any = {
+        nickName: "金砖大王",
+        uid: "1234567890"
+    }
     /** 视图层逻辑代码分离演示 */
     start() {
         // const entity = this.ent as ecs.Entity;         // ecs.Entity 可转为当前模块的具体实体对象
+        this.setButton();
     }
 
     /** 视图对象通过 ecs.Entity.remove(SettingViewComp) 删除组件是触发组件处理自定义释放逻辑 */
     reset() {
         this.node.destroy();
     }
+
+
+    private btn_about() {
+        oops.gui.open(UIID.AboutUs);
+    }
+
+
+    private btn_close() {
+        oops.gui.remove(UIID.Setting);
+    }
+
+
+    private btn_cache() {
+        oops.gui.toast("清理成功");
+    }
 }

+ 5 - 3
assets/script/game/eliminate/view/eliminateViewComp.ts

@@ -2,12 +2,14 @@
  * @Author: mojunshou 1637302775@qq.com
  * @Date: 2025-03-20 15:01:09
  * @LastEditors: mojunshou 1637302775@qq.com
- * @LastEditTime: 2025-03-20 15:14:13
+ * @LastEditTime: 2025-03-20 16:16:25
  * @Description: 消除游戏主场景
  */
 import { _decorator } from "cc";
+import { oops } from "db://oops-framework/core/Oops";
 import { ecs } from "db://oops-framework/libs/ecs/ECS";
 import { CCComp } from "db://oops-framework/module/common/CCComp";
+import { UIID } from "../../common/config/GameUIConfig";
 
 const { ccclass, property } = _decorator;
 
@@ -32,8 +34,8 @@ export class eliminateViewComp extends CCComp {
 
 
     private btn_setting() {
+        oops.gui.open(UIID.Setting);
+    }
 
 
-
-    }
 }