Browse Source

增加转盘

zouyong 5 years ago
parent
commit
02b11f91e5

+ 189 - 48
mk_framework/assets/resources/game/prefab/game.prefab

@@ -30,11 +30,11 @@
     "_active": true,
     "_components": [
       {
-        "__id__": 26
+        "__id__": 30
       }
     ],
     "_prefab": {
-      "__id__": 27
+      "__id__": 31
     },
     "_opacity": 255,
     "_color": {
@@ -271,25 +271,96 @@
     "_children": [
       {
         "__id__": 8
+      }
+    ],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 28
+      }
+    ],
+    "_prefab": {
+      "__id__": 29
+    },
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 750,
+      "height": 0
+    },
+    "_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.Node",
+    "_name": "右侧按钮",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 7
+    },
+    "_children": [
+      {
+        "__id__": 9
       },
       {
-        "__id__": 13
+        "__id__": 14
       },
       {
-        "__id__": 18
+        "__id__": 19
       },
       {
-        "__id__": 21
+        "__id__": 22
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 24
+        "__id__": 25
+      },
+      {
+        "__id__": 26
       }
     ],
     "_prefab": {
-      "__id__": 25
+      "__id__": 27
     },
     "_opacity": 255,
     "_color": {
@@ -301,8 +372,8 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 0,
-      "height": 0
+      "width": 120,
+      "height": 376
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -313,7 +384,7 @@
       "__type__": "TypedArray",
       "ctor": "Float64Array",
       "array": [
-        0,
+        315,
         0,
         0,
         0,
@@ -343,20 +414,20 @@
     "_name": "btn1",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 7
+      "__id__": 8
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 9
+        "__id__": 10
       },
       {
-        "__id__": 10
+        "__id__": 11
       }
     ],
     "_prefab": {
-      "__id__": 12
+      "__id__": 13
     },
     "_opacity": 255,
     "_color": {
@@ -380,8 +451,8 @@
       "__type__": "TypedArray",
       "ctor": "Float64Array",
       "array": [
-        294.11,
-        23.634,
+        0,
+        148.5,
         0,
         0,
         0,
@@ -410,7 +481,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 8
+      "__id__": 9
     },
     "_enabled": true,
     "_materials": [
@@ -442,14 +513,14 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 8
+      "__id__": 9
     },
     "_enabled": true,
     "panel_name": "pigBank",
     "open_type": 0,
     "panel_type": 2,
     "onComplete": {
-      "__id__": 11
+      "__id__": 12
     },
     "_id": ""
   },
@@ -469,7 +540,7 @@
     "asset": {
       "__uuid__": "b4dea4a9-29c8-46bc-a50d-5754afa7a2bd"
     },
-    "fileId": "26f7oDYUlAwJGa8O5zPqy7",
+    "fileId": "3bTV7m8GtCWqsEcWTq44VU",
     "sync": false
   },
   {
@@ -477,20 +548,20 @@
     "_name": "btn2",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 7
+      "__id__": 8
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 14
+        "__id__": 15
       },
       {
-        "__id__": 15
+        "__id__": 16
       }
     ],
     "_prefab": {
-      "__id__": 17
+      "__id__": 18
     },
     "_opacity": 255,
     "_color": {
@@ -514,8 +585,8 @@
       "__type__": "TypedArray",
       "ctor": "Float64Array",
       "array": [
-        294.11,
-        -81.406,
+        0,
+        49.5,
         0,
         0,
         0,
@@ -544,7 +615,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 13
+      "__id__": 14
     },
     "_enabled": true,
     "_materials": [
@@ -576,14 +647,14 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 13
+      "__id__": 14
     },
     "_enabled": true,
     "panel_name": "turnable",
     "open_type": 0,
     "panel_type": 2,
     "onComplete": {
-      "__id__": 16
+      "__id__": 17
     },
     "_id": ""
   },
@@ -603,7 +674,7 @@
     "asset": {
       "__uuid__": "b4dea4a9-29c8-46bc-a50d-5754afa7a2bd"
     },
-    "fileId": "6ai1KK3EZOOo3tsgUc/hIs",
+    "fileId": "28mtypHBpKWqf1+r+PxtYP",
     "sync": false
   },
   {
@@ -611,17 +682,17 @@
     "_name": "btn3",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 7
+      "__id__": 8
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 19
+        "__id__": 20
       }
     ],
     "_prefab": {
-      "__id__": 20
+      "__id__": 21
     },
     "_opacity": 255,
     "_color": {
@@ -645,8 +716,8 @@
       "__type__": "TypedArray",
       "ctor": "Float64Array",
       "array": [
-        286.232,
-        -199.575,
+        0,
+        -49.5,
         0,
         0,
         0,
@@ -675,7 +746,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 18
+      "__id__": 19
     },
     "_enabled": true,
     "_materials": [
@@ -710,7 +781,7 @@
     "asset": {
       "__uuid__": "b4dea4a9-29c8-46bc-a50d-5754afa7a2bd"
     },
-    "fileId": "dc8E3b0UlJ7IEISy/txUOM",
+    "fileId": "37Ri7bf4JGGZLhiuFuoCVd",
     "sync": false
   },
   {
@@ -718,17 +789,17 @@
     "_name": "btn4",
     "_objFlags": 0,
     "_parent": {
-      "__id__": 7
+      "__id__": 8
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 22
+        "__id__": 23
       }
     ],
     "_prefab": {
-      "__id__": 23
+      "__id__": 24
     },
     "_opacity": 255,
     "_color": {
@@ -752,8 +823,8 @@
       "__type__": "TypedArray",
       "ctor": "Float64Array",
       "array": [
-        288.858,
-        -309.866,
+        0,
+        -148.5,
         0,
         0,
         0,
@@ -782,7 +853,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 21
+      "__id__": 22
     },
     "_enabled": true,
     "_materials": [
@@ -817,7 +888,77 @@
     "asset": {
       "__uuid__": "b4dea4a9-29c8-46bc-a50d-5754afa7a2bd"
     },
-    "fileId": "a1mRWcJ/NBGLazviqsh0vO",
+    "fileId": "55zJbz0VhJToN19ojfpLV5",
+    "sync": false
+  },
+  {
+    "__type__": "cc.Layout",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 8
+    },
+    "_enabled": true,
+    "_layoutSize": {
+      "__type__": "cc.Size",
+      "width": 120,
+      "height": 376
+    },
+    "_resize": 1,
+    "_N$layoutType": 2,
+    "_N$cellSize": {
+      "__type__": "cc.Size",
+      "width": 40,
+      "height": 40
+    },
+    "_N$startAxis": 0,
+    "_N$paddingLeft": 0,
+    "_N$paddingRight": 0,
+    "_N$paddingTop": 0,
+    "_N$paddingBottom": 0,
+    "_N$spacingX": 0,
+    "_N$spacingY": 20,
+    "_N$verticalDirection": 1,
+    "_N$horizontalDirection": 0,
+    "_N$affectedByScale": false,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Widget",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 8
+    },
+    "_enabled": true,
+    "alignMode": 1,
+    "_target": null,
+    "_alignFlags": 32,
+    "_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__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__uuid__": "b4dea4a9-29c8-46bc-a50d-5754afa7a2bd"
+    },
+    "fileId": "6deDVtdrBEmonrwLZF9lJJ",
     "sync": false
   },
   {
@@ -829,16 +970,16 @@
     },
     "_enabled": true,
     "btn1": {
-      "__id__": 8
+      "__id__": 9
     },
     "btn2": {
-      "__id__": 13
+      "__id__": 14
     },
     "btn3": {
-      "__id__": 18
+      "__id__": 19
     },
     "btn4": {
-      "__id__": 21
+      "__id__": 22
     },
     "_id": ""
   },

+ 305 - 0
mk_framework/assets/resources/module/turnable/item.prefab

@@ -0,0 +1,305 @@
+[
+  {
+    "__type__": "cc.Prefab",
+    "_name": "",
+    "_objFlags": 0,
+    "_native": "",
+    "data": {
+      "__id__": 1
+    },
+    "optimizationPolicy": 0,
+    "asyncLoadAssets": false,
+    "readonly": false
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "item",
+    "_objFlags": 0,
+    "_parent": null,
+    "_children": [
+      {
+        "__id__": 2
+      },
+      {
+        "__id__": 5
+      }
+    ],
+    "_active": true,
+    "_components": [],
+    "_prefab": {
+      "__id__": 8
+    },
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 255,
+      "g": 255,
+      "b": 255,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 0,
+      "height": 0
+    },
+    "_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.Node",
+    "_name": "hb",
+    "_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": 128,
+      "height": 94
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_trs": {
+      "__type__": "TypedArray",
+      "ctor": "Float64Array",
+      "array": [
+        0,
+        202.625,
+        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.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 2
+    },
+    "_enabled": true,
+    "_materials": [
+      {
+        "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
+      }
+    ],
+    "_srcBlendFactor": 770,
+    "_dstBlendFactor": 771,
+    "_spriteFrame": {
+      "__uuid__": "90285806-551f-49ec-af5b-d8aea2c938b4"
+    },
+    "_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.PrefabInfo",
+    "root": {
+      "__id__": 2
+    },
+    "asset": {
+      "__uuid__": "29d84a7b-1843-43ee-ac07-c4458c76035a"
+    },
+    "fileId": "87pllbpidAepDuIXAprZLN",
+    "sync": false
+  },
+  {
+    "__type__": "cc.Node",
+    "_name": "大量红包",
+    "_objFlags": 0,
+    "_parent": {
+      "__id__": 1
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 6
+      }
+    ],
+    "_prefab": {
+      "__id__": 7
+    },
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 152,
+      "g": 57,
+      "b": 0,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 120,
+      "height": 37.8
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0.5,
+      "y": 0.5
+    },
+    "_trs": {
+      "__type__": "TypedArray",
+      "ctor": "Float64Array",
+      "array": [
+        1.559,
+        121.575,
+        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__": 5
+    },
+    "_enabled": true,
+    "_materials": [
+      {
+        "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
+      }
+    ],
+    "_srcBlendFactor": 770,
+    "_dstBlendFactor": 771,
+    "_string": "大量红包",
+    "_N$string": "大量红包",
+    "_fontSize": 30,
+    "_lineHeight": 30,
+    "_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__": 5
+    },
+    "asset": {
+      "__uuid__": "135db755-1a7a-43cb-8f33-0c42cd2031c3"
+    },
+    "fileId": "a7LHeYawBIjpSQ5q/bEGyU",
+    "sync": false
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__id__": 0
+    },
+    "fileId": "",
+    "sync": false
+  }
+]

+ 8 - 0
mk_framework/assets/resources/module/turnable/item.prefab.meta

@@ -0,0 +1,8 @@
+{
+  "ver": "1.2.9",
+  "uuid": "1cdb74f7-8929-44c0-987f-ce38a49c2d05",
+  "optimizationPolicy": "AUTO",
+  "asyncLoadAssets": false,
+  "readonly": false,
+  "subMetas": {}
+}

BIN
mk_framework/assets/resources/module/turnable/texture/close.png


+ 36 - 0
mk_framework/assets/resources/module/turnable/texture/close.png.meta

@@ -0,0 +1,36 @@
+{
+  "ver": "2.3.5",
+  "uuid": "6d5c49e4-b12a-4e93-b38c-fd08e34084dd",
+  "type": "sprite",
+  "wrapMode": "clamp",
+  "filterMode": "bilinear",
+  "premultiplyAlpha": false,
+  "genMipmaps": false,
+  "packable": true,
+  "width": 53,
+  "height": 49,
+  "platformSettings": {},
+  "subMetas": {
+    "close": {
+      "ver": "1.0.4",
+      "uuid": "a8db3196-9d7a-401d-b5cc-d788b4390c4e",
+      "rawTextureUuid": "6d5c49e4-b12a-4e93-b38c-fd08e34084dd",
+      "trimType": "auto",
+      "trimThreshold": 1,
+      "rotated": false,
+      "offsetX": 0,
+      "offsetY": 0,
+      "trimX": 0,
+      "trimY": 0,
+      "width": 53,
+      "height": 49,
+      "rawWidth": 53,
+      "rawHeight": 49,
+      "borderTop": 0,
+      "borderBottom": 0,
+      "borderLeft": 0,
+      "borderRight": 0,
+      "subMetas": {}
+    }
+  }
+}

File diff suppressed because it is too large
+ 2189 - 3
mk_framework/assets/resources/module/turnable/turnable.prefab


+ 54 - 0
mk_framework/assets/script/game/component/Button.ts

@@ -0,0 +1,54 @@
+const { ccclass, property } = cc._decorator;
+
+@ccclass
+export default class Button extends cc.Component {
+
+    @property({ type: cc.Node, displayName: "正常" })
+    node_normal: cc.Node = null;
+    @property({ type: cc.Node, displayName: "按下" })
+    node_pressed: cc.Node = null;
+    @property({ type: cc.Node, displayName: "禁用" })
+    node_disabled: cc.Node = null;
+    @property({ displayName: "点击函数", type: cc.Component.EventHandler })
+    public onClick: cc.Component.EventHandler[] = [];
+
+    onLoad() {
+        this.touchEnd();
+    }
+
+    start() {
+        this.node.on(cc.Node.EventType.TOUCH_START, this.touchStart, this);
+        this.node.on(cc.Node.EventType.TOUCH_END, this.touchEnd, this);
+        this.node.on("click", this.click, this);
+    }
+
+    private touchStart() {
+        this.node_normal.active = false;
+        this.node_pressed.active = true;
+        this.node_disabled.active = false;
+    }
+
+    private touchEnd() {
+        this.node_normal.active = true;
+        this.node_pressed.active = false;
+        this.node_disabled.active = false;
+    }
+
+    private click() {
+        let c_count = this.onClick.length;
+        for (let i = 0; i < c_count; i++) {
+            if (this.onClick[i].handler) {
+                this.onClick[i].emit([]);
+            }
+        }
+    }
+
+    onDestroy(){
+        this.node.off(cc.Node.EventType.TOUCH_START, this.touchStart, this);
+        this.node.off(cc.Node.EventType.TOUCH_END, this.touchEnd, this);
+        this.node.off("click", this.click, this);
+        this.onClick = [];
+    }
+
+    
+}

+ 9 - 0
mk_framework/assets/script/game/component/Button.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "c7d0c86f-0518-4f95-8d2b-24594316738d",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 1 - 1
mk_framework/assets/script/game/data/g.ts

@@ -40,7 +40,7 @@ class g {
     public initModuleData(data){
         this.moduleDataMap = new Map<string,Data>();
         
-        for
+        
     }
     
     getModuleData(key:string){

+ 3 - 1
mk_framework/assets/script/game/module/game/FunBtns.ts

@@ -25,7 +25,9 @@ export default class FunBtns extends cc.Component {
     init() {
         let data = [1, 1, 0, 1];
         for (let i = 0; i < data.length; i++) {
-            this['btn' + (i + 1)].active = data[i] == 1;
+            if (data[i] == 0) {
+                this['btn' + (i + 1)].active = data[i] == 1;
+            }
         }
     }
 }

+ 4 - 2
mk_framework/assets/script/game/module/module/turntable/Turnable.ts

@@ -4,7 +4,7 @@ const { ccclass, property } = cc._decorator;
 export default class Turnable extends cc.Component {
 
     onLoad() {
-        
+
     }
 
     start() {
@@ -12,9 +12,11 @@ export default class Turnable extends cc.Component {
 
     }
 
+    clickBtn() {
 
+    }
 
     update() {
-        
+
     }
 }

+ 25 - 0
mk_framework/assets/script/game/module/module/turntable/TurnableItem.ts

@@ -0,0 +1,25 @@
+const { ccclass, property } = cc._decorator;
+
+@ccclass
+export default class Turnable extends cc.Component {
+    @property(cc.Sprite)
+    icon: cc.Sprite = null;
+    @property(cc.Label)
+    lbl_name: cc.Label = null;
+
+    onLoad() {
+
+    }
+
+    start() {
+
+    }
+
+    clickBtn() {
+
+    }
+
+    update() {
+
+    }
+}

+ 9 - 0
mk_framework/assets/script/game/module/module/turntable/TurnableItem.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.8",
+  "uuid": "2df9fa52-585d-46d5-afe8-b3612fef3e58",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

Some files were not shown because too many files changed in this diff