Просмотр исходного кода

红包码列表添加教程按钮及功能

薛鸿潇 5 лет назад
Родитель
Сommit
91c355fc9f

+ 207 - 7
assets/resources/module/redBagCode/redBagCode.prefab

@@ -24,20 +24,20 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 29
+        "__id__": 34
       },
       {
-        "__id__": 30
+        "__id__": 35
       },
       {
-        "__id__": 31
+        "__id__": 36
       },
       {
-        "__id__": 32
+        "__id__": 37
       }
     ],
     "_prefab": {
-      "__id__": 33
+      "__id__": 38
     },
     "_opacity": 255,
     "_color": {
@@ -108,16 +108,19 @@
       },
       {
         "__id__": 24
+      },
+      {
+        "__id__": 27
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 27
+        "__id__": 32
       }
     ],
     "_prefab": {
-      "__id__": 28
+      "__id__": 33
     },
     "_opacity": 255,
     "_color": {
@@ -989,6 +992,200 @@
     "sync": false
   },
   {
+    "__type__": "cc.Node",
+    "_name": "视频按钮",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 2
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 28
+      },
+      {
+        "__id__": 29
+      }
+    ],
+    "_prefab": {
+      "__id__": 31
+    },
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 206,
+      "height": 115
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_trs": {
+      "__type__": "TypedArray",
+      "ctor": "Float64Array",
+      "array": [
+        -219,
+        -285.929,
+        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": ""
+  },
+  {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 27
+    },
+    "_enabled": true,
+    "_materials": [
+      {
+        "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
+      }
+    ],
+    "_srcBlendFactor": 770,
+    "_dstBlendFactor": 771,
+    "_spriteFrame": {
+      "__uuid__": "e8f358fc-75b7-4bc5-a106-c623cadfc9ed"
+    },
+    "_type": 0,
+    "_sizeMode": 1,
+    "_fillType": 0,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_atlas": null,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Button",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 27
+    },
+    "_enabled": true,
+    "_normalMaterial": {
+      "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
+    },
+    "_grayMaterial": null,
+    "duration": 0.1,
+    "zoomScale": 1.2,
+    "clickEvents": [
+      {
+        "__id__": 30
+      }
+    ],
+    "_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": ""
+  },
+  {
+    "__type__": "cc.ClickEvent",
+    "target": {
+      "__id__": 1
+    },
+    "component": "",
+    "_componentId": "f7616rh8MtO1ZZziaU2Xf1w",
+    "handler": "clickTeach",
+    "customEventData": ""
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__uuid__": "157bf3d2-0395-4138-a922-782117d5c979"
+    },
+    "fileId": "67sJgI3fdJvZzQ7ZfOcxJ2",
+    "sync": false
+  },
+  {
     "__type__": "cc.Widget",
     "_name": "",
     "_objFlags": 0,
@@ -1040,6 +1237,9 @@
     "lbl_none": {
       "__id__": 25
     },
+    "videoPre": {
+      "__uuid__": "33e934e4-3ffd-4bc1-bd4d-58a9b515f7f5"
+    },
     "_id": ""
   },
   {

BIN
assets/resources/module/redBagCode/texture/jiaocheng.png


+ 36 - 0
assets/resources/module/redBagCode/texture/jiaocheng.png.meta

@@ -0,0 +1,36 @@
+{
+  "ver": "2.3.5",
+  "uuid": "6bf3a36e-1a91-4890-a98e-0545d9301823",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": false,
+  "genMipmaps": false,
+  "packable": true,
+  "width": 206,
+  "height": 115,
+  "platformSettings": {},
+  "subMetas": {
+    "jiaocheng": {
+      "ver": "1.0.4",
+      "uuid": "e8f358fc-75b7-4bc5-a106-c623cadfc9ed",
+      "rawTextureUuid": "6bf3a36e-1a91-4890-a98e-0545d9301823",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": 0,
+      "offsetY": 0,
+      "trimX": 0,
+      "trimY": 0,
+      "width": 206,
+      "height": 115,
+      "rawWidth": 206,
+      "rawHeight": 115,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

Разница между файлами не показана из-за своего большого размера
+ 296 - 121
assets/resources/module/redCode/redCode.prefab


+ 27 - 1
assets/script/game/module/redBagCode/RedBagCode.ts

@@ -11,7 +11,8 @@ export default class RedBagCode extends cc.Component {
     private scroll_view: cc.ScrollView = null!;
     @property({ displayName: 'lbl暂无提现', type: cc.Label })
     private lbl_none: cc.Label = null;
-    // onLoad () {}
+    @property(cc.Prefab)
+    videoPre: cc.Prefab = null;
 
     start() {
         this.initList();
@@ -38,4 +39,29 @@ export default class RedBagCode extends cc.Component {
             this.lbl_none.node.active = true;
         }
     }
+
+    coolTime = false
+    videoNode = null
+    /** 点击教程 */
+    clickTeach() {
+        mk.audio.playEffect('button');
+        if (this.coolTime) {
+            return
+        }
+
+        this.coolTime = true
+
+        gData.redCodeData.teachVideoType = 1;
+        console.log('clickTeach')
+        this.videoNode = cc.instantiate(this.videoPre)
+        this.videoNode.getChildByName('video').on("completed", this.onCompleted, this)
+        this.node.addChild(this.videoNode)
+    }
+
+    onCompleted() {
+        this.videoNode.getChildByName('video').off("completed", this.onCompleted, this)
+        this.videoNode.destroy()
+        mk.audio.setResumeMusic();
+        this.coolTime = false
+    }
 }

Некоторые файлы не были показаны из-за большого количества измененных файлов