Quellcode durchsuchen

强引导使用星云数据

薛鸿潇 vor 5 Jahren
Ursprung
Commit
7a7afbe1c3

+ 12 - 0
assets/resources/module/guideWeak.meta

@@ -0,0 +1,12 @@
+{
+  "ver": "1.1.2",
+  "uuid": "ab5e8500-43f4-483b-a621-6ddbaaf94257",
+  "isBundle": false,
+  "bundleName": "",
+  "priority": 1,
+  "compressionType": {},
+  "optimizeHotUpdate": {},
+  "inlineSpriteFrames": {},
+  "isRemoteBundle": {},
+  "subMetas": {}
+}

+ 241 - 0
assets/resources/module/guideWeak/GuideWeak.prefab

@@ -0,0 +1,241 @@
+[
+  {
+    "__type__": "cc.Prefab",
+    "_name": "",
+    "_objFlags": 0,
+    "_native": "",
+    "data": {
+      "__id__": 1
+    },
+    "optimizationPolicy": 0,
+    "asyncLoadAssets": false,
+    "readonly": false
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "GuideWeak",
+    "_objFlags": 0,
+    "_parent": null,
+    "_children": [
+      {
+        "__id__": 2
+      }
+    ],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 5
+      },
+      {
+        "__id__": 6
+      }
+    ],
+    "_prefab": {
+      "__id__": 7
+    },
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 750,
+      "height": 1334
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_trs": {
+      "__type__": "TypedArray",
+      "ctor": "Float64Array",
+      "array": [
+        375,
+        667,
+        0,
+        0,
+        0,
+        0,
+        1,
+        1,
+        1,
+        1
+      ]
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_is3DNode": false,
+    "_groupIndex": 0,
+    "groupIndex": 0,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "New Label",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 3
+      }
+    ],
+    "_prefab": {
+      "__id__": 4
+    },
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 240,
+      "height": 50.4
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_trs": {
+      "__type__": "TypedArray",
+      "ctor": "Float64Array",
+      "array": [
+        0,
+        0,
+        0,
+        0,
+        0,
+        0,
+        1,
+        1,
+        1,
+        1
+      ]
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_is3DNode": false,
+    "_groupIndex": 0,
+    "groupIndex": 0,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Label",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 2
+    },
+    "_enabled": true,
+    "_materials": [
+      {
+        "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
+      }
+    ],
+    "_srcBlendFactor": 770,
+    "_dstBlendFactor": 771,
+    "_string": "若引导运行中",
+    "_N$string": "若引导运行中",
+    "_fontSize": 40,
+    "_lineHeight": 40,
+    "_enableWrapText": true,
+    "_N$file": null,
+    "_isSystemFontUsed": true,
+    "_spacingX": 0,
+    "_batchAsBitmap": false,
+    "_styleFlags": 0,
+    "_underlineHeight": 0,
+    "_N$horizontalAlign": 1,
+    "_N$verticalAlign": 1,
+    "_N$fontFamily": "Arial",
+    "_N$overflow": 0,
+    "_N$cacheMode": 0,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__uuid__": "ba2e33b2-5a64-424b-8b08-247fed4be0f0"
+    },
+    "fileId": "9bpVbHl+FJeqHz4I/c2T/+",
+    "sync": false
+  },
+  {
+    "__type__": "cc.Widget",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": true,
+    "alignMode": 1,
+    "_target": null,
+    "_alignFlags": 45,
+    "_left": 0,
+    "_right": 0,
+    "_top": 0,
+    "_bottom": 0,
+    "_verticalCenter": 0,
+    "_horizontalCenter": 0,
+    "_isAbsLeft": true,
+    "_isAbsRight": true,
+    "_isAbsTop": true,
+    "_isAbsBottom": true,
+    "_isAbsHorizontalCenter": true,
+    "_isAbsVerticalCenter": true,
+    "_originalWidth": 0,
+    "_originalHeight": 0,
+    "_id": ""
+  },
+  {
+    "__type__": "f13f5zT97NMpINpXOCogVAt",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 1
+    },
+    "_enabled": true,
+    "label": null,
+    "text": "hello",
+    "_id": ""
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__uuid__": "ba2e33b2-5a64-424b-8b08-247fed4be0f0"
+    },
+    "fileId": "",
+    "sync": false
+  }
+]

+ 8 - 0
assets/resources/module/guideWeak/GuideWeak.prefab.meta

@@ -0,0 +1,8 @@
+{
+  "ver": "1.2.9",
+  "uuid": "ba2e33b2-5a64-424b-8b08-247fed4be0f0",
+  "optimizationPolicy": "AUTO",
+  "asyncLoadAssets": false,
+  "readonly": false,
+  "subMetas": {}
+}

+ 1 - 0
assets/script/game/data/GameData.ts

@@ -64,6 +64,7 @@ export class GameData {
         mk.console.logSingle("getInfoCrypt", response.data);
         this.initPlayerProp(response.data)
         this.initProps(response.data.gameUserData);
+        gData.guideData.init();
         gData.moduleData.forEach(element => {
             element.init();
         });

+ 1 - 5
assets/script/game/data/LoginData.ts

@@ -45,13 +45,9 @@ export class LoginData {
         if (result && result.json) {
             this.rule_data = result.json.server;
             this.privacy_data = result.json.privacy;
-        }
-
-        result = await mk.loader.load("data/guide_data", cc.JsonAsset);
-        if (result && result.json) {
-            gData.guideData.init(result.json);
             this.loadResCompelete = true;
         }
+
     }
 
     /**

+ 17 - 7
assets/script/game/data/module/GuideData.ts

@@ -1,3 +1,5 @@
+import { Data } from "../../../mk/data/Data";
+
 /**
  * @description 新手引导
  * @author 邹勇
@@ -10,7 +12,15 @@ export class GuideData {
     /** 当前引导id */
     public crtID: number = null;
 
-    public init(config) {
+    public async init() {
+        let config = gData.gameData.configs.Guide
+        if (!config) {
+            let result = await mk.loader.load("data/guide_data", cc.JsonAsset);
+            if (result && result.json) {
+                config = result.json;
+            }
+            cc.log('无远程引导数据,使用本地测试数据');
+        }
         this.data = new Map<number, GuideVO[]>();
         let arr = [];
         let id = 1;
@@ -21,13 +31,13 @@ export class GuideData {
             guide.id = parseInt(a[0]);
             guide.step = parseInt(a[1]);
             guide.trigger = o.trigger;
-            guide.tr_num = o.tr_num;
-            guide.tr_form = o.tr_form;
+            guide.tr_num = o.tr_num || o.trNum;
+            guide.tr_form = o.tr_form || o.trForm;
             guide.dialog = o.dialog;
-            guide.display_rect = o.display_rect;
-            guide.click_rect = o.click_rect;
-            guide.finger = o.finger;
-            guide.lag_next = o.lag_next;
+            guide.display_rect = o.display_rect || o.displayRect;
+            guide.click_rect = o.click_rect || o.clickRect;
+            guide.finger = o.finger || '';
+            guide.lag_next = o.lag_next || o.lagNext;
             if (id != guide.id) {
                 this.data.set(id, arr);
                 arr = [];

+ 17 - 0
assets/script/game/data/module/GuideWeakData.ts

@@ -0,0 +1,17 @@
+import { Data } from "../../../mk/data/Data";
+
+const { ccclass, property } = cc._decorator;
+/**
+ * 弱引导数据
+ * @author 薛鸿潇
+ */
+@ccclass
+export default class GuideWeakData extends Data {
+
+    /**
+     * 数据初始化
+     */
+    public init() {
+
+    }
+}

+ 9 - 0
assets/script/game/data/module/GuideWeakData.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "8cbac365-032d-482a-a894-53d83ede033c",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 12 - 0
assets/script/game/module/guideWeak.meta

@@ -0,0 +1,12 @@
+{
+  "ver": "1.1.2",
+  "uuid": "e5435836-5de8-4f99-82ac-2ba5fa3b30ea",
+  "isBundle": false,
+  "bundleName": "",
+  "priority": 1,
+  "compressionType": {},
+  "optimizeHotUpdate": {},
+  "inlineSpriteFrames": {},
+  "isRemoteBundle": {},
+  "subMetas": {}
+}

+ 28 - 0
assets/script/game/module/guideWeak/GuideWeak.ts

@@ -0,0 +1,28 @@
+// Learn TypeScript:
+//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
+// Learn Attribute:
+//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
+// Learn life-cycle callbacks:
+//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
+
+const {ccclass, property} = cc._decorator;
+
+@ccclass
+export default class NewClass extends cc.Component {
+
+    @property(cc.Label)
+    label: cc.Label = null;
+
+    @property
+    text: string = 'hello';
+
+    // LIFE-CYCLE CALLBACKS:
+
+    // onLoad () {}
+
+    start () {
+
+    }
+
+    // update (dt) {}
+}

+ 9 - 0
assets/script/game/module/guideWeak/GuideWeak.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "f13f5cd3-f7b3-4ca4-8369-5ce0a881502d",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}