Переглянути джерело

【修改】:
1.替换资源;
2.新增返回按钮;

youhaitao 2 роки тому
батько
коміт
4f9b17d609

+ 224 - 9
assets/main/SceneMain.fire

@@ -76,18 +76,21 @@
       },
       {
         "__id__": 7
+      },
+      {
+        "__id__": 12
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 12
+        "__id__": 17
       },
       {
-        "__id__": 13
+        "__id__": 18
       },
       {
-        "__id__": 14
+        "__id__": 19
       }
     ],
     "_prefab": null,
@@ -361,8 +364,8 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 100,
-      "height": 100
+      "width": 130,
+      "height": 130
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -373,8 +376,8 @@
       "__type__": "TypedArray",
       "ctor": "Float64Array",
       "array": [
-        900,
-        480,
+        785,
+        435,
         0,
         0,
         0,
@@ -442,8 +445,8 @@
     "_target": null,
     "_alignFlags": 33,
     "_left": 0,
-    "_right": 10,
-    "_top": 10,
+    "_right": 110,
+    "_top": 40,
     "_bottom": 0,
     "_verticalCenter": 0,
     "_horizontalCenter": 0,
@@ -539,6 +542,215 @@
     "handler": "msgResultEnterGame",
     "customEventData": ""
   },
+  {
+    "__type__": "cc.Node",
+    "_name": "btnBack",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 2
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 13
+      },
+      {
+        "__id__": 14
+      },
+      {
+        "__id__": 15
+      }
+    ],
+    "_prefab": null,
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 130,
+      "height": 130
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_trs": {
+      "__type__": "TypedArray",
+      "ctor": "Float64Array",
+      "array": [
+        -785,
+        435,
+        0,
+        0,
+        0,
+        0,
+        1,
+        1,
+        1,
+        0
+      ]
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_is3DNode": false,
+    "_groupIndex": 0,
+    "groupIndex": 0,
+    "_id": "ec26rDBSxOQpCICuJE2/wN"
+  },
+  {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 12
+    },
+    "_enabled": true,
+    "_materials": [
+      {
+        "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
+      }
+    ],
+    "_srcBlendFactor": 1,
+    "_dstBlendFactor": 771,
+    "_spriteFrame": {
+      "__uuid__": "a358e5b2-68ba-4033-8bcf-27545af89765"
+    },
+    "_type": 0,
+    "_sizeMode": 0,
+    "_fillType": 0,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_atlas": null,
+    "_id": "9fQADbw6lDrrt6lczHWTEl"
+  },
+  {
+    "__type__": "cc.Widget",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 12
+    },
+    "_enabled": true,
+    "alignMode": 1,
+    "_target": null,
+    "_alignFlags": 9,
+    "_left": 110,
+    "_right": 0,
+    "_top": 40,
+    "_bottom": 0,
+    "_verticalCenter": 0,
+    "_horizontalCenter": 0,
+    "_isAbsLeft": true,
+    "_isAbsRight": true,
+    "_isAbsTop": true,
+    "_isAbsBottom": true,
+    "_isAbsHorizontalCenter": true,
+    "_isAbsVerticalCenter": true,
+    "_originalWidth": 0,
+    "_originalHeight": 0,
+    "_id": "dcZNt4jVZMKLKmRw+DakgB"
+  },
+  {
+    "__type__": "cc.Button",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 12
+    },
+    "_enabled": true,
+    "_normalMaterial": null,
+    "_grayMaterial": null,
+    "duration": 0.1,
+    "zoomScale": 1.2,
+    "clickEvents": [
+      {
+        "__id__": 16
+      }
+    ],
+    "_N$interactable": true,
+    "_N$enableAutoGrayEffect": false,
+    "_N$transition": 3,
+    "transition": 3,
+    "_N$normalColor": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_N$pressedColor": {
+      "__type__": "cc.Color",
+      "r": 211,
+      "g": 211,
+      "b": 211,
+      "a": 255
+    },
+    "pressedColor": {
+      "__type__": "cc.Color",
+      "r": 211,
+      "g": 211,
+      "b": 211,
+      "a": 255
+    },
+    "_N$hoverColor": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "hoverColor": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_N$disabledColor": {
+      "__type__": "cc.Color",
+      "r": 124,
+      "g": 124,
+      "b": 124,
+      "a": 255
+    },
+    "_N$normalSprite": null,
+    "_N$pressedSprite": null,
+    "pressedSprite": null,
+    "_N$hoverSprite": null,
+    "hoverSprite": null,
+    "_N$disabledSprite": null,
+    "_N$target": null,
+    "_id": "34uOypLyBOwpNML0pzyerV"
+  },
+  {
+    "__type__": "cc.ClickEvent",
+    "target": {
+      "__id__": 2
+    },
+    "component": "",
+    "_componentId": "a7298bq3FdA5q0czxWVszqG",
+    "handler": "eventBack",
+    "customEventData": ""
+  },
   {
     "__type__": "cc.Canvas",
     "_name": "",
@@ -582,6 +794,9 @@
     "btnNext": {
       "__id__": 7
     },
+    "btnBack": {
+      "__id__": 12
+    },
     "_id": "80oQpM9U1KTIx7FH0iSB/b"
   },
   {

+ 16 - 18
assets/main/SceneMain.ts

@@ -33,6 +33,9 @@ export default class Scene extends cc.Component {
     @property({ tooltip: '下一个游戏', type: cc.Node })
     btnNext: cc.Node = null;
 
+    @property({ tooltip: '返回', type: cc.Node })
+    btnBack: cc.Node = null;
+
     nodeShow: cc.Node = null; // 显示节点
     nodeVideo: cc.Node = null;
     nodeStart: cc.Node = null;
@@ -152,6 +155,7 @@ export default class Scene extends cc.Component {
         this.node.addChild(this.nodeStart, CConst.ZORDER_LJG_START);
         this.node.addChild(this.nodeFinish, CConst.ZORDER_LJG_FINISH);
         this.btnNext.zIndex = CConst.ZORDER_BUTTON_NEXT;
+        this.btnBack.zIndex = CConst.ZORDER_BUTTON_NEXT;
 
         this.nodeShow = null;
     }
@@ -259,18 +263,20 @@ export default class Scene extends cc.Component {
             this.addPrefab(curUint, curPage + 1);
         }
         else {
-            this.scheduleOnce(()=>{
+            this.scheduleOnce(() => {
                 // 返回课程详情页
                 common.httpReplaceUrl(common.urlClass);
             }, 0.5);
         }
     }
 
-    /**
-     * 根据 组件名 获取 脚本组件
-     * @param scriptName 
-     * @returns 
-     */
+    /** 返回详情页面 */
+    eventBack() {
+        let url = common.urlClass + '?id=' + common.getCourseId() + '&mode=luojigou';
+        window.location.replace(url);
+    }
+
+    /** 根据 组件名 获取 脚本组件 */
     getScriptByNode(node: cc.Node, scriptName: string): any {
         if (!node || !scriptName) return null;
         let script = node.getComponent(scriptName);
@@ -280,17 +286,13 @@ export default class Scene extends cc.Component {
         return script;
     };
 
-    /**
-     * 窗口变化回调
-     */
+    /** 窗口变化回调 */
     protected onResize() {
         // 适配
         this.adapt();
     }
 
-    /**
-    * 适配
-    */
+    /** 适配 */
     protected adapt() {
         // 实际屏幕比例
         const winSize = cc.winSize,
@@ -311,18 +313,14 @@ export default class Scene extends cc.Component {
         }
     }
 
-    /**
-     * 适配高度模式
-     */
+    /** 适配高度模式 */
     protected setFitHeight() {
         const canvas = cc.Canvas.instance;
         canvas.fitHeight = true;
         canvas.fitWidth = false;
     }
 
-    /**
-     * 适配宽度模式
-     */
+    /** 适配宽度模式 */
     protected setFitWidth() {
         const canvas = cc.Canvas.instance;
         canvas.fitHeight = false;

BIN
assets/res/common/img/btnBack.png


+ 38 - 0
assets/res/common/img/btnBack.png.meta

@@ -0,0 +1,38 @@
+{
+  "ver": "2.3.7",
+  "uuid": "894ffb62-7380-44a4-b6c4-a01befb74ca9",
+  "importer": "texture",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": true,
+  "genMipmaps": false,
+  "packable": true,
+  "width": 88,
+  "height": 88,
+  "platformSettings": {},
+  "subMetas": {
+    "btnBack": {
+      "ver": "1.0.6",
+      "uuid": "a358e5b2-68ba-4033-8bcf-27545af89765",
+      "importer": "sprite-frame",
+      "rawTextureUuid": "894ffb62-7380-44a4-b6c4-a01befb74ca9",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": 0,
+      "offsetY": 0,
+      "trimX": 1,
+      "trimY": 1,
+      "width": 88,
+      "height": 88,
+      "rawWidth": 90,
+      "rawHeight": 90,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

BIN
assets/res/common/img/btnNext.png


+ 8 - 8
assets/res/common/img/btnNext.png.meta

@@ -8,8 +8,8 @@
   "premultiplyAlpha": true,
   "genMipmaps": false,
   "packable": true,
-  "width": 91,
-  "height": 93,
+  "width": 90,
+  "height": 90,
   "platformSettings": {},
   "subMetas": {
     "btnNext": {
@@ -22,12 +22,12 @@
       "rotated": false,
       "offsetX": 0,
       "offsetY": 0,
-      "trimX": 0,
-      "trimY": 0,
-      "width": 91,
-      "height": 93,
-      "rawWidth": 91,
-      "rawHeight": 93,
+      "trimX": 1,
+      "trimY": 1,
+      "width": 88,
+      "height": 88,
+      "rawWidth": 90,
+      "rawHeight": 90,
       "borderTop": 0,
       "borderBottom": 0,
       "borderLeft": 0,

+ 1 - 1
settings/project.json

@@ -2,7 +2,7 @@
   "migrate-history": [
     "cloud-function"
   ],
-  "last-module-event-record-time": 1666666856054,
+  "last-module-event-record-time": 1668395348053,
   "group-list": [
     "default"
   ],