diff --git a/assets/Prefab/Column.prefab b/assets/Prefab/Column.prefab index fe2c9d1..6dcc247 100644 --- a/assets/Prefab/Column.prefab +++ b/assets/Prefab/Column.prefab @@ -523,6 +523,8 @@ }, "_enabled": true, "gameModule": null, + "rollMinSpeed": 1, + "rollMaxSpeed": 15, "_id": "" }, { diff --git a/assets/Scene/catSlot.fire b/assets/Scene/catSlot.fire index 10b3634..8b3ad33 100644 --- a/assets/Scene/catSlot.fire +++ b/assets/Scene/catSlot.fire @@ -72,40 +72,40 @@ "__id__": 3 }, { - "__id__": 45 + "__id__": 61 }, { - "__id__": 72 + "__id__": 88 }, { - "__id__": 74 + "__id__": 90 }, { - "__id__": 77 + "__id__": 93 }, { - "__id__": 54 + "__id__": 70 }, { - "__id__": 90 + "__id__": 106 }, { - "__id__": 52 + "__id__": 68 }, { - "__id__": 50 + "__id__": 66 }, { - "__id__": 48 + "__id__": 64 } ], "_active": true, "_components": [ { - "__id__": 109 + "__id__": 125 }, { - "__id__": 110 + "__id__": 126 } ], "_prefab": null, @@ -178,12 +178,18 @@ }, { "__id__": 36 + }, + { + "__id__": 44 + }, + { + "__id__": 52 } ], "_active": true, "_components": [ { - "__id__": 44 + "__id__": 60 } ], "_prefab": null, @@ -660,7 +666,7 @@ "__type__": "TypedArray", "ctor": "Float64Array", "array": [ - 121.754, + 456.212, 0, 0, 0, @@ -831,8 +837,8 @@ ], "_srcBlendFactor": 770, "_dstBlendFactor": 771, - "_string": "Column1 OFF", - "_N$string": "Column1 OFF", + "_string": "ON/OFF", + "_N$string": "ON/OFF", "_fontSize": 20, "_lineHeight": 40, "_enableWrapText": false, @@ -1019,7 +1025,777 @@ "_active": true, "_components": [ { - "__id__": 26 + "__id__": 26 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 100, + "height": 40 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 563.55, + 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": "0c0JfSu5BMW70w81WxOSzF" + }, + { + "__type__": "cc.Node", + "_name": "Background", + "_objFlags": 512, + "_parent": { + "__id__": 20 + }, + "_children": [ + { + "__id__": 22 + } + ], + "_active": true, + "_components": [ + { + "__id__": 24 + }, + { + "__id__": 25 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 100, + "height": 40 + }, + "_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": "a3074GC4dAFb2pJnIg9pBc" + }, + { + "__type__": "cc.Node", + "_name": "Unit Test 3", + "_objFlags": 512, + "_parent": { + "__id__": 21 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 23 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 100, + "height": 40 + }, + "_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": "bf8bMCfNNMjKZ0FgTliMka" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 22 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_string": "Item Change", + "_N$string": "Item Change", + "_fontSize": 20, + "_lineHeight": 40, + "_enableWrapText": false, + "_N$file": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, + "_N$horizontalAlign": 1, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 1, + "_N$cacheMode": 1, + "_id": "d4R6wZ1IpFzoBWTx4weAm0" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 21 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" + }, + "_type": 1, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "71pJCIIm5EJYMNjDOkBkRo" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 21 + }, + "_enabled": true, + "alignMode": 0, + "_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": 100, + "_originalHeight": 40, + "_id": "4c30wZB/5D0p8ONB+MBMfJ" + }, + { + "__type__": "cc.Button", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 20 + }, + "_enabled": true, + "_normalMaterial": null, + "_grayMaterial": null, + "duration": 0.1, + "zoomScale": 1.2, + "clickEvents": [ + { + "__id__": 27 + } + ], + "_N$interactable": true, + "_N$enableAutoGrayEffect": false, + "_N$transition": 2, + "transition": 2, + "_N$normalColor": { + "__type__": "cc.Color", + "r": 230, + "g": 230, + "b": 230, + "a": 255 + }, + "_N$pressedColor": { + "__type__": "cc.Color", + "r": 200, + "g": 200, + "b": 200, + "a": 255 + }, + "pressedColor": { + "__type__": "cc.Color", + "r": 200, + "g": 200, + "b": 200, + "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": 120, + "g": 120, + "b": 120, + "a": 200 + }, + "_N$normalSprite": { + "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" + }, + "_N$pressedSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "pressedSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "_N$hoverSprite": { + "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" + }, + "hoverSprite": { + "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" + }, + "_N$disabledSprite": { + "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" + }, + "_N$target": { + "__id__": 21 + }, + "_id": "b2zQw1ARJMyJUvsRPmsmow" + }, + { + "__type__": "cc.ClickEvent", + "target": { + "__id__": 3 + }, + "component": "", + "_componentId": "1edd7n0LUBGnLjt0REtLUFZ", + "handler": "unitTest3", + "customEventData": "" + }, + { + "__type__": "cc.Node", + "_name": "UT4", + "_objFlags": 0, + "_parent": { + "__id__": 3 + }, + "_children": [ + { + "__id__": 29 + } + ], + "_active": true, + "_components": [ + { + "__id__": 34 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 100, + "height": 40 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 113.898, + -2.883, + 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": "97g+hB/mhOaYxPHrIhqh79" + }, + { + "__type__": "cc.Node", + "_name": "Background", + "_objFlags": 512, + "_parent": { + "__id__": 28 + }, + "_children": [ + { + "__id__": 30 + } + ], + "_active": true, + "_components": [ + { + "__id__": 32 + }, + { + "__id__": 33 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 100, + "height": 40 + }, + "_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": "bech3yuKxCMI3gZJfE2D6Z" + }, + { + "__type__": "cc.Node", + "_name": "Label", + "_objFlags": 512, + "_parent": { + "__id__": 29 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 31 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 100, + "height": 40 + }, + "_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": "38PpZgotlDJYrwkq62f1Oz" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 30 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_string": "UT4", + "_N$string": "UT4", + "_fontSize": 20, + "_lineHeight": 40, + "_enableWrapText": false, + "_N$file": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_batchAsBitmap": false, + "_styleFlags": 0, + "_underlineHeight": 0, + "_N$horizontalAlign": 1, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 1, + "_N$cacheMode": 1, + "_id": "f0gysXc69HF7/H6VipU3uz" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 29 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" + }, + "_type": 1, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "93rBluNo1KW5EplFGDGqy+" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 29 + }, + "_enabled": true, + "alignMode": 0, + "_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": 100, + "_originalHeight": 40, + "_id": "a2/XIDM9VFtJtzoHonmvIg" + }, + { + "__type__": "cc.Button", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 28 + }, + "_enabled": true, + "_normalMaterial": null, + "_grayMaterial": null, + "duration": 0.1, + "zoomScale": 1.2, + "clickEvents": [ + { + "__id__": 35 + } + ], + "_N$interactable": true, + "_N$enableAutoGrayEffect": false, + "_N$transition": 2, + "transition": 2, + "_N$normalColor": { + "__type__": "cc.Color", + "r": 230, + "g": 230, + "b": 230, + "a": 255 + }, + "_N$pressedColor": { + "__type__": "cc.Color", + "r": 200, + "g": 200, + "b": 200, + "a": 255 + }, + "pressedColor": { + "__type__": "cc.Color", + "r": 200, + "g": 200, + "b": 200, + "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": 120, + "g": 120, + "b": 120, + "a": 200 + }, + "_N$normalSprite": { + "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" + }, + "_N$pressedSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "pressedSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "_N$hoverSprite": { + "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" + }, + "hoverSprite": { + "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" + }, + "_N$disabledSprite": { + "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" + }, + "_N$target": { + "__id__": 29 + }, + "_id": "52gIeYkE5OEaY4Tts0RPj6" + }, + { + "__type__": "cc.ClickEvent", + "target": { + "__id__": 3 + }, + "component": "", + "_componentId": "1edd7n0LUBGnLjt0REtLUFZ", + "handler": "test4", + "customEventData": "" + }, + { + "__type__": "cc.Node", + "_name": "UT5", + "_objFlags": 0, + "_parent": { + "__id__": 3 + }, + "_children": [ + { + "__id__": 37 + } + ], + "_active": true, + "_components": [ + { + "__id__": 42 } ], "_prefab": null, @@ -1045,7 +1821,7 @@ "__type__": "TypedArray", "ctor": "Float64Array", "array": [ - 243.508, + 674.092, 0, 0, 0, @@ -1068,27 +1844,27 @@ "_is3DNode": false, "_groupIndex": 0, "groupIndex": 0, - "_id": "0c0JfSu5BMW70w81WxOSzF" + "_id": "a3m+a0/8ND7ZBOMHNz+gaX" }, { "__type__": "cc.Node", "_name": "Background", "_objFlags": 512, "_parent": { - "__id__": 20 + "__id__": 36 }, "_children": [ { - "__id__": 22 + "__id__": 38 } ], "_active": true, "_components": [ { - "__id__": 24 + "__id__": 40 }, { - "__id__": 25 + "__id__": 41 } ], "_prefab": null, @@ -1137,20 +1913,20 @@ "_is3DNode": false, "_groupIndex": 0, "groupIndex": 0, - "_id": "a3074GC4dAFb2pJnIg9pBc" + "_id": "21EYGRx4xFfIWY9HCRwcu0" }, { "__type__": "cc.Node", - "_name": "Unit Test 3", + "_name": "Label", "_objFlags": 512, "_parent": { - "__id__": 21 + "__id__": 37 }, "_children": [], "_active": true, "_components": [ { - "__id__": 23 + "__id__": 39 } ], "_prefab": null, @@ -1199,14 +1975,14 @@ "_is3DNode": false, "_groupIndex": 0, "groupIndex": 0, - "_id": "bf8bMCfNNMjKZ0FgTliMka" + "_id": "2bQ/dTreBFYakGDhpWtWcP" }, { "__type__": "cc.Label", "_name": "", "_objFlags": 0, "node": { - "__id__": 22 + "__id__": 38 }, "_enabled": true, "_materials": [ @@ -1216,8 +1992,8 @@ ], "_srcBlendFactor": 770, "_dstBlendFactor": 771, - "_string": "Column1 Change", - "_N$string": "Column1 Change", + "_string": "Pending", + "_N$string": "Pending", "_fontSize": 20, "_lineHeight": 40, "_enableWrapText": false, @@ -1232,14 +2008,14 @@ "_N$fontFamily": "Arial", "_N$overflow": 1, "_N$cacheMode": 1, - "_id": "d4R6wZ1IpFzoBWTx4weAm0" + "_id": "15SJcKiLxIzLSTLNB8p0Om" }, { "__type__": "cc.Sprite", "_name": "", "_objFlags": 0, "node": { - "__id__": 21 + "__id__": 37 }, "_enabled": true, "_materials": [ @@ -1264,14 +2040,14 @@ "_fillRange": 0, "_isTrimmedMode": true, "_atlas": null, - "_id": "71pJCIIm5EJYMNjDOkBkRo" + "_id": "3btnfVuJ5As7A0hrSNVzTR" }, { "__type__": "cc.Widget", "_name": "", "_objFlags": 0, "node": { - "__id__": 21 + "__id__": 37 }, "_enabled": true, "alignMode": 0, @@ -1291,14 +2067,14 @@ "_isAbsVerticalCenter": true, "_originalWidth": 100, "_originalHeight": 40, - "_id": "4c30wZB/5D0p8ONB+MBMfJ" + "_id": "1dDOOw8UtNP53q0ZsyOaxj" }, { "__type__": "cc.Button", "_name": "", "_objFlags": 0, "node": { - "__id__": 20 + "__id__": 36 }, "_enabled": true, "_normalMaterial": null, @@ -1307,7 +2083,7 @@ "zoomScale": 1.2, "clickEvents": [ { - "__id__": 27 + "__id__": 43 } ], "_N$interactable": true, @@ -1375,9 +2151,9 @@ "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" }, "_N$target": { - "__id__": 21 + "__id__": 37 }, - "_id": "b2zQw1ARJMyJUvsRPmsmow" + "_id": "a1eEDw7WROQq7sza0SrFyj" }, { "__type__": "cc.ClickEvent", @@ -1386,25 +2162,25 @@ }, "component": "", "_componentId": "1edd7n0LUBGnLjt0REtLUFZ", - "handler": "unitTest3", + "handler": "test5", "customEventData": "" }, { "__type__": "cc.Node", - "_name": "UT4", + "_name": "UT6", "_objFlags": 0, "_parent": { "__id__": 3 }, "_children": [ { - "__id__": 29 + "__id__": 45 } ], "_active": true, "_components": [ { - "__id__": 34 + "__id__": 50 } ], "_prefab": null, @@ -1430,7 +2206,7 @@ "__type__": "TypedArray", "ctor": "Float64Array", "array": [ - 364.742, + 787.13, 0, 0, 0, @@ -1453,27 +2229,27 @@ "_is3DNode": false, "_groupIndex": 0, "groupIndex": 0, - "_id": "97g+hB/mhOaYxPHrIhqh79" + "_id": "70RqV34vpNXpNSR3LMQJkk" }, { "__type__": "cc.Node", "_name": "Background", "_objFlags": 512, "_parent": { - "__id__": 28 + "__id__": 44 }, "_children": [ { - "__id__": 30 + "__id__": 46 } ], "_active": true, "_components": [ { - "__id__": 32 + "__id__": 48 }, { - "__id__": 33 + "__id__": 49 } ], "_prefab": null, @@ -1522,20 +2298,20 @@ "_is3DNode": false, "_groupIndex": 0, "groupIndex": 0, - "_id": "bech3yuKxCMI3gZJfE2D6Z" + "_id": "b97Knc0VpJx6cpY5YmCAix" }, { "__type__": "cc.Node", "_name": "Label", "_objFlags": 512, "_parent": { - "__id__": 29 + "__id__": 45 }, "_children": [], "_active": true, "_components": [ { - "__id__": 31 + "__id__": 47 } ], "_prefab": null, @@ -1584,14 +2360,14 @@ "_is3DNode": false, "_groupIndex": 0, "groupIndex": 0, - "_id": "38PpZgotlDJYrwkq62f1Oz" + "_id": "0czTyaNnNB/KDoT1mqwKNT" }, { "__type__": "cc.Label", "_name": "", "_objFlags": 0, "node": { - "__id__": 30 + "__id__": 46 }, "_enabled": true, "_materials": [ @@ -1601,8 +2377,8 @@ ], "_srcBlendFactor": 770, "_dstBlendFactor": 771, - "_string": "UT4", - "_N$string": "UT4", + "_string": "Spin 1", + "_N$string": "Spin 1", "_fontSize": 20, "_lineHeight": 40, "_enableWrapText": false, @@ -1617,14 +2393,14 @@ "_N$fontFamily": "Arial", "_N$overflow": 1, "_N$cacheMode": 1, - "_id": "f0gysXc69HF7/H6VipU3uz" + "_id": "57Po6hg4RL86yn7r/C1I7C" }, { "__type__": "cc.Sprite", "_name": "", "_objFlags": 0, "node": { - "__id__": 29 + "__id__": 45 }, "_enabled": true, "_materials": [ @@ -1649,14 +2425,14 @@ "_fillRange": 0, "_isTrimmedMode": true, "_atlas": null, - "_id": "93rBluNo1KW5EplFGDGqy+" + "_id": "ed32xOpoJGv6tINt8yG4lT" }, { "__type__": "cc.Widget", "_name": "", "_objFlags": 0, "node": { - "__id__": 29 + "__id__": 45 }, "_enabled": true, "alignMode": 0, @@ -1676,14 +2452,14 @@ "_isAbsVerticalCenter": true, "_originalWidth": 100, "_originalHeight": 40, - "_id": "a2/XIDM9VFtJtzoHonmvIg" + "_id": "62pWgBf/VFSbRiScifun01" }, { "__type__": "cc.Button", "_name": "", "_objFlags": 0, "node": { - "__id__": 28 + "__id__": 44 }, "_enabled": true, "_normalMaterial": null, @@ -1692,7 +2468,7 @@ "zoomScale": 1.2, "clickEvents": [ { - "__id__": 35 + "__id__": 51 } ], "_N$interactable": true, @@ -1760,9 +2536,9 @@ "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" }, "_N$target": { - "__id__": 29 + "__id__": 45 }, - "_id": "52gIeYkE5OEaY4Tts0RPj6" + "_id": "d7CAk3ZnpHWrqITl1rD9cW" }, { "__type__": "cc.ClickEvent", @@ -1771,25 +2547,25 @@ }, "component": "", "_componentId": "1edd7n0LUBGnLjt0REtLUFZ", - "handler": "test4", + "handler": "test6", "customEventData": "" }, { "__type__": "cc.Node", - "_name": "UT5", + "_name": "UT7", "_objFlags": 0, "_parent": { "__id__": 3 }, "_children": [ { - "__id__": 37 + "__id__": 53 } ], "_active": true, "_components": [ { - "__id__": 42 + "__id__": 58 } ], "_prefab": null, @@ -1815,8 +2591,8 @@ "__type__": "TypedArray", "ctor": "Float64Array", "array": [ - 576.062, 0, + 60.345, 0, 0, 0, @@ -1838,27 +2614,27 @@ "_is3DNode": false, "_groupIndex": 0, "groupIndex": 0, - "_id": "a3m+a0/8ND7ZBOMHNz+gaX" + "_id": "24iNHYsyJK+7EUPishnYKc" }, { "__type__": "cc.Node", "_name": "Background", "_objFlags": 512, "_parent": { - "__id__": 36 + "__id__": 52 }, "_children": [ { - "__id__": 38 + "__id__": 54 } ], "_active": true, "_components": [ { - "__id__": 40 + "__id__": 56 }, { - "__id__": 41 + "__id__": 57 } ], "_prefab": null, @@ -1907,20 +2683,20 @@ "_is3DNode": false, "_groupIndex": 0, "groupIndex": 0, - "_id": "21EYGRx4xFfIWY9HCRwcu0" + "_id": "37Qjajd3BPNI5JKYiq9oXE" }, { "__type__": "cc.Node", "_name": "Label", "_objFlags": 512, "_parent": { - "__id__": 37 + "__id__": 53 }, "_children": [], "_active": true, "_components": [ { - "__id__": 39 + "__id__": 55 } ], "_prefab": null, @@ -1969,14 +2745,14 @@ "_is3DNode": false, "_groupIndex": 0, "groupIndex": 0, - "_id": "2bQ/dTreBFYakGDhpWtWcP" + "_id": "f0RXf0mTtOSpA4g8ydgSEf" }, { "__type__": "cc.Label", "_name": "", "_objFlags": 0, "node": { - "__id__": 38 + "__id__": 54 }, "_enabled": true, "_materials": [ @@ -1986,8 +2762,8 @@ ], "_srcBlendFactor": 770, "_dstBlendFactor": 771, - "_string": "Force Stop", - "_N$string": "Force Stop", + "_string": "speedFactor", + "_N$string": "speedFactor", "_fontSize": 20, "_lineHeight": 40, "_enableWrapText": false, @@ -2002,14 +2778,14 @@ "_N$fontFamily": "Arial", "_N$overflow": 1, "_N$cacheMode": 1, - "_id": "15SJcKiLxIzLSTLNB8p0Om" + "_id": "37bsXpkslOQLKpCUWFYuaI" }, { "__type__": "cc.Sprite", "_name": "", "_objFlags": 0, "node": { - "__id__": 37 + "__id__": 53 }, "_enabled": true, "_materials": [ @@ -2034,14 +2810,14 @@ "_fillRange": 0, "_isTrimmedMode": true, "_atlas": null, - "_id": "3btnfVuJ5As7A0hrSNVzTR" + "_id": "6boMvmpaxMn6Z8gbMszDHu" }, { "__type__": "cc.Widget", "_name": "", "_objFlags": 0, "node": { - "__id__": 37 + "__id__": 53 }, "_enabled": true, "alignMode": 0, @@ -2061,14 +2837,14 @@ "_isAbsVerticalCenter": true, "_originalWidth": 100, "_originalHeight": 40, - "_id": "1dDOOw8UtNP53q0ZsyOaxj" + "_id": "60s2S4oqNDc7qsCMQrcEqQ" }, { "__type__": "cc.Button", "_name": "", "_objFlags": 0, "node": { - "__id__": 36 + "__id__": 52 }, "_enabled": true, "_normalMaterial": null, @@ -2077,7 +2853,7 @@ "zoomScale": 1.2, "clickEvents": [ { - "__id__": 43 + "__id__": 59 } ], "_N$interactable": true, @@ -2145,9 +2921,9 @@ "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" }, "_N$target": { - "__id__": 37 + "__id__": 53 }, - "_id": "a1eEDw7WROQq7sza0SrFyj" + "_id": "06gT8CdINGPb76WEtpw6AX" }, { "__type__": "cc.ClickEvent", @@ -2156,7 +2932,7 @@ }, "component": "", "_componentId": "1edd7n0LUBGnLjt0REtLUFZ", - "handler": "test5", + "handler": "test7", "customEventData": "" }, { @@ -2168,10 +2944,10 @@ }, "_enabled": true, "gameModule": { - "__id__": 45 + "__id__": 61 }, "columnControl": { - "__id__": 55 + "__id__": 71 }, "_id": "99SFs6+AdA2Lb2lKWDJqV6" }, @@ -2186,7 +2962,7 @@ "_active": true, "_components": [ { - "__id__": 46 + "__id__": 62 } ], "_prefab": null, @@ -2242,25 +3018,25 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 45 + "__id__": 61 }, "_enabled": true, "columnCount": 5, "itemSize": 240, "betString": { - "__id__": 47 + "__id__": 63 }, "bigFrameString": { - "__id__": 49 + "__id__": 65 }, "balanceString": { - "__id__": 51 + "__id__": 67 }, "columnPrefab": { "__uuid__": "6893d156-7164-405e-9d78-612b1b0f4b03" }, "slotBoard": { - "__id__": 53 + "__id__": 69 }, "_id": "71e+XuWaxCKbeSrfqcYX9v" }, @@ -2269,7 +3045,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 48 + "__id__": 64 }, "_enabled": true, "_materials": [ @@ -2308,7 +3084,7 @@ "_active": true, "_components": [ { - "__id__": 47 + "__id__": 63 } ], "_prefab": null, @@ -2364,7 +3140,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 50 + "__id__": 66 }, "_enabled": true, "_materials": [ @@ -2403,7 +3179,7 @@ "_active": true, "_components": [ { - "__id__": 49 + "__id__": 65 } ], "_prefab": null, @@ -2459,7 +3235,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 52 + "__id__": 68 }, "_enabled": true, "_materials": [ @@ -2498,7 +3274,7 @@ "_active": true, "_components": [ { - "__id__": 51 + "__id__": 67 } ], "_prefab": null, @@ -2554,20 +3330,20 @@ "_name": "slotBoard", "_objFlags": 0, "_parent": { - "__id__": 54 + "__id__": 70 }, "_children": [ { - "__id__": 55 + "__id__": 71 } ], "_active": true, "_components": [ { - "__id__": 70 + "__id__": 86 }, { - "__id__": 71 + "__id__": 87 } ], "_prefab": null, @@ -2627,7 +3403,7 @@ }, "_children": [ { - "__id__": 53 + "__id__": 69 } ], "_active": true, @@ -2685,30 +3461,30 @@ "_name": "Column", "_objFlags": 0, "_parent": { - "__id__": 53 + "__id__": 69 }, "_children": [ { - "__id__": 56 + "__id__": 72 }, { - "__id__": 59 + "__id__": 75 }, { - "__id__": 62 + "__id__": 78 }, { - "__id__": 65 + "__id__": 81 } ], "_active": false, "_components": [ { - "__id__": 68 + "__id__": 84 } ], "_prefab": { - "__id__": 69 + "__id__": 85 }, "_opacity": 255, "_color": { @@ -2762,17 +3538,17 @@ "_name": "item0", "_objFlags": 0, "_parent": { - "__id__": 55 + "__id__": 71 }, "_children": [], "_active": true, "_components": [ { - "__id__": 57 + "__id__": 73 } ], "_prefab": { - "__id__": 58 + "__id__": 74 }, "_opacity": 255, "_color": { @@ -2826,7 +3602,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 56 + "__id__": 72 }, "_enabled": true, "_materials": [ @@ -2856,7 +3632,7 @@ { "__type__": "cc.PrefabInfo", "root": { - "__id__": 55 + "__id__": 71 }, "asset": { "__uuid__": "6893d156-7164-405e-9d78-612b1b0f4b03" @@ -2869,17 +3645,17 @@ "_name": "item1", "_objFlags": 0, "_parent": { - "__id__": 55 + "__id__": 71 }, "_children": [], "_active": true, "_components": [ { - "__id__": 60 + "__id__": 76 } ], "_prefab": { - "__id__": 61 + "__id__": 77 }, "_opacity": 255, "_color": { @@ -2933,7 +3709,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 59 + "__id__": 75 }, "_enabled": true, "_materials": [ @@ -2963,7 +3739,7 @@ { "__type__": "cc.PrefabInfo", "root": { - "__id__": 55 + "__id__": 71 }, "asset": { "__uuid__": "6893d156-7164-405e-9d78-612b1b0f4b03" @@ -2976,17 +3752,17 @@ "_name": "item2", "_objFlags": 0, "_parent": { - "__id__": 55 + "__id__": 71 }, "_children": [], "_active": true, "_components": [ { - "__id__": 63 + "__id__": 79 } ], "_prefab": { - "__id__": 64 + "__id__": 80 }, "_opacity": 255, "_color": { @@ -3040,7 +3816,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 62 + "__id__": 78 }, "_enabled": true, "_materials": [ @@ -3070,7 +3846,7 @@ { "__type__": "cc.PrefabInfo", "root": { - "__id__": 55 + "__id__": 71 }, "asset": { "__uuid__": "6893d156-7164-405e-9d78-612b1b0f4b03" @@ -3083,17 +3859,17 @@ "_name": "item3", "_objFlags": 0, "_parent": { - "__id__": 55 + "__id__": 71 }, "_children": [], "_active": true, "_components": [ { - "__id__": 66 + "__id__": 82 } ], "_prefab": { - "__id__": 67 + "__id__": 83 }, "_opacity": 255, "_color": { @@ -3147,7 +3923,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 65 + "__id__": 81 }, "_enabled": true, "_materials": [ @@ -3177,7 +3953,7 @@ { "__type__": "cc.PrefabInfo", "root": { - "__id__": 55 + "__id__": 71 }, "asset": { "__uuid__": "6893d156-7164-405e-9d78-612b1b0f4b03" @@ -3190,17 +3966,18 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 55 + "__id__": 71 }, "_enabled": true, "gameModule": null, - "rollSpeed": 1, + "rollMinSpeed": 1, + "rollMaxSpeed": 15, "_id": "20vhsnLCJCCJHvd1bPup2s" }, { "__type__": "cc.PrefabInfo", "root": { - "__id__": 55 + "__id__": 71 }, "asset": { "__uuid__": "6893d156-7164-405e-9d78-612b1b0f4b03" @@ -3213,7 +3990,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 53 + "__id__": 69 }, "_enabled": true, "_layoutSize": { @@ -3245,7 +4022,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 53 + "__id__": 69 }, "_enabled": true, "_materials": [ @@ -3271,7 +4048,7 @@ "_active": true, "_components": [ { - "__id__": 73 + "__id__": 89 } ], "_prefab": null, @@ -3327,7 +4104,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 72 + "__id__": 88 }, "_enabled": true, "_cullingMask": 4294967295, @@ -3369,10 +4146,10 @@ "_active": true, "_components": [ { - "__id__": 75 + "__id__": 91 }, { - "__id__": 76 + "__id__": 92 } ], "_prefab": null, @@ -3428,7 +4205,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 74 + "__id__": 90 }, "_enabled": true, "alignMode": 0, @@ -3455,7 +4232,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 74 + "__id__": 90 }, "_enabled": true, "_materials": [ @@ -3491,22 +4268,22 @@ }, "_children": [ { - "__id__": 78 + "__id__": 94 }, { - "__id__": 80 + "__id__": 96 }, { - "__id__": 82 + "__id__": 98 }, { - "__id__": 84 + "__id__": 100 }, { - "__id__": 86 + "__id__": 102 }, { - "__id__": 88 + "__id__": 104 } ], "_active": true, @@ -3564,13 +4341,13 @@ "_name": "bg_board", "_objFlags": 0, "_parent": { - "__id__": 77 + "__id__": 93 }, "_children": [], "_active": true, "_components": [ { - "__id__": 79 + "__id__": 95 } ], "_prefab": null, @@ -3626,7 +4403,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 78 + "__id__": 94 }, "_enabled": true, "_materials": [ @@ -3658,13 +4435,13 @@ "_name": "frame_big", "_objFlags": 0, "_parent": { - "__id__": 77 + "__id__": 93 }, "_children": [], "_active": true, "_components": [ { - "__id__": 81 + "__id__": 97 } ], "_prefab": null, @@ -3720,7 +4497,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 80 + "__id__": 96 }, "_enabled": true, "_materials": [ @@ -3752,13 +4529,13 @@ "_name": "frame_balance", "_objFlags": 0, "_parent": { - "__id__": 77 + "__id__": 93 }, "_children": [], "_active": true, "_components": [ { - "__id__": 83 + "__id__": 99 } ], "_prefab": null, @@ -3814,7 +4591,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 82 + "__id__": 98 }, "_enabled": true, "_materials": [ @@ -3846,13 +4623,13 @@ "_name": "frame_bet", "_objFlags": 0, "_parent": { - "__id__": 77 + "__id__": 93 }, "_children": [], "_active": true, "_components": [ { - "__id__": 85 + "__id__": 101 } ], "_prefab": null, @@ -3908,7 +4685,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 84 + "__id__": 100 }, "_enabled": true, "_materials": [ @@ -3940,13 +4717,13 @@ "_name": "label_balance", "_objFlags": 0, "_parent": { - "__id__": 77 + "__id__": 93 }, "_children": [], "_active": true, "_components": [ { - "__id__": 87 + "__id__": 103 } ], "_prefab": null, @@ -4002,7 +4779,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 86 + "__id__": 102 }, "_enabled": true, "_materials": [ @@ -4034,13 +4811,13 @@ "_name": "label_bet", "_objFlags": 0, "_parent": { - "__id__": 77 + "__id__": 93 }, "_children": [], "_active": true, "_components": [ { - "__id__": 89 + "__id__": 105 } ], "_prefab": null, @@ -4096,7 +4873,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 88 + "__id__": 104 }, "_enabled": true, "_materials": [ @@ -4132,13 +4909,13 @@ }, "_children": [ { - "__id__": 91 + "__id__": 107 }, { - "__id__": 97 + "__id__": 113 }, { - "__id__": 103 + "__id__": 119 } ], "_active": true, @@ -4196,17 +4973,17 @@ "_name": "btn_plus", "_objFlags": 0, "_parent": { - "__id__": 90 + "__id__": 106 }, "_children": [ { - "__id__": 92 + "__id__": 108 } ], "_active": true, "_components": [ { - "__id__": 95 + "__id__": 111 } ], "_prefab": null, @@ -4262,16 +5039,16 @@ "_name": "Background", "_objFlags": 512, "_parent": { - "__id__": 91 + "__id__": 107 }, "_children": [], "_active": true, "_components": [ { - "__id__": 93 + "__id__": 109 }, { - "__id__": 94 + "__id__": 110 } ], "_prefab": null, @@ -4327,7 +5104,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 92 + "__id__": 108 }, "_enabled": true, "_materials": [ @@ -4359,7 +5136,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 92 + "__id__": 108 }, "_enabled": true, "alignMode": 0, @@ -4386,7 +5163,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 91 + "__id__": 107 }, "_enabled": true, "_normalMaterial": null, @@ -4395,7 +5172,7 @@ "zoomScale": 1.2, "clickEvents": [ { - "__id__": 96 + "__id__": 112 } ], "_N$interactable": true, @@ -4463,14 +5240,14 @@ "__uuid__": "aebdca29-2957-456d-9604-1f9be79b52a5" }, "_N$target": { - "__id__": 92 + "__id__": 108 }, "_id": "36j6k0EEtC9o2aAYVhynLd" }, { "__type__": "cc.ClickEvent", "target": { - "__id__": 45 + "__id__": 61 }, "component": "", "_componentId": "1bc61/a9X9MN5/EwQIdMfv2", @@ -4482,17 +5259,17 @@ "_name": "btn_minus", "_objFlags": 0, "_parent": { - "__id__": 90 + "__id__": 106 }, "_children": [ { - "__id__": 98 + "__id__": 114 } ], "_active": true, "_components": [ { - "__id__": 101 + "__id__": 117 } ], "_prefab": null, @@ -4548,16 +5325,16 @@ "_name": "Background", "_objFlags": 512, "_parent": { - "__id__": 97 + "__id__": 113 }, "_children": [], "_active": true, "_components": [ { - "__id__": 99 + "__id__": 115 }, { - "__id__": 100 + "__id__": 116 } ], "_prefab": null, @@ -4613,7 +5390,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 98 + "__id__": 114 }, "_enabled": true, "_materials": [ @@ -4645,7 +5422,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 98 + "__id__": 114 }, "_enabled": true, "alignMode": 0, @@ -4672,7 +5449,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 97 + "__id__": 113 }, "_enabled": true, "_normalMaterial": null, @@ -4681,7 +5458,7 @@ "zoomScale": 1.2, "clickEvents": [ { - "__id__": 102 + "__id__": 118 } ], "_N$interactable": true, @@ -4749,14 +5526,14 @@ "__uuid__": "089a7fbb-dfb9-437d-abe9-4597ee1ca4bf" }, "_N$target": { - "__id__": 98 + "__id__": 114 }, "_id": "2aiXByUwNPYqe6c5hGMZPF" }, { "__type__": "cc.ClickEvent", "target": { - "__id__": 45 + "__id__": 61 }, "component": "", "_componentId": "1bc61/a9X9MN5/EwQIdMfv2", @@ -4768,17 +5545,17 @@ "_name": "btn_spin", "_objFlags": 0, "_parent": { - "__id__": 90 + "__id__": 106 }, "_children": [ { - "__id__": 104 + "__id__": 120 } ], "_active": true, "_components": [ { - "__id__": 107 + "__id__": 123 } ], "_prefab": null, @@ -4834,16 +5611,16 @@ "_name": "Background", "_objFlags": 512, "_parent": { - "__id__": 103 + "__id__": 119 }, "_children": [], "_active": true, "_components": [ { - "__id__": 105 + "__id__": 121 }, { - "__id__": 106 + "__id__": 122 } ], "_prefab": null, @@ -4899,7 +5676,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 104 + "__id__": 120 }, "_enabled": true, "_materials": [ @@ -4931,7 +5708,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 104 + "__id__": 120 }, "_enabled": true, "alignMode": 0, @@ -4958,7 +5735,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 103 + "__id__": 119 }, "_enabled": true, "_normalMaterial": null, @@ -4967,7 +5744,7 @@ "zoomScale": 1.2, "clickEvents": [ { - "__id__": 108 + "__id__": 124 } ], "_N$interactable": true, @@ -5035,14 +5812,14 @@ "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" }, "_N$target": { - "__id__": 104 + "__id__": 120 }, "_id": "b0f2aeSLZMEb88FCu4QB5S" }, { "__type__": "cc.ClickEvent", "target": { - "__id__": 45 + "__id__": 61 }, "component": "", "_componentId": "1bc61/a9X9MN5/EwQIdMfv2", diff --git a/assets/Script/columnControl.ts b/assets/Script/columnControl.ts index 4100bd8..601db2a 100644 --- a/assets/Script/columnControl.ts +++ b/assets/Script/columnControl.ts @@ -1,13 +1,16 @@ const {ccclass, property} = cc._decorator; -import {gameMY, moduleState} from './gameModule'; +import {gameMY, moduleState, columnCondition} from './gameModule'; export enum columnState { Ready = 1, - Spining = 2, - Stopping = 3, + Start = 2, + Delay = 3, + Spining = 4, + Slowing = 5, + Stopping = 6, EngStop = 99, @@ -25,88 +28,168 @@ export class columnControl extends cc.Component { gameModule: cc.Node; @property(Number) - rollSpeed:number = 1; + rollMinSpeed:number = 1; - // private nowAction = null; - private columnItem: Array = []; - private itemList:Array; + @property(Number) + rollMaxSpeed:number = 10; + + private itemPool:Array; // 全部的 item 對應 + private waitingList:Array = []; // 預計要顯示的item + private finalList:Array = []; // 預計要停下的item + private currentList:Array = []; // 現在正在顯示的item + private speedFactor:number = 0; // 調速用變數 + private N:number; // 調速用變數 + private M:number; // 調速用變數 + private t:number; // 調速用變數 private gameModuleScript:gameMY; - nowState:columnState; + nowState:columnState; // 狀態機previousState + spinCondition:columnCondition; // 從 gameModule 吃過來的旋轉資訊 protected onLoad () { + // 一些防呆 + if(this.rollMaxSpeed < this.rollMinSpeed) throw new Error('rollMaxSpeed need to greater than rollMinSpeed'); + this.gameModuleScript = this.gameModule.getComponent('gameMY'); } protected start () { - this.itemList = Object.values(this.gameModuleScript.itemNameMapping); + this.itemPool = Object.values(this.gameModuleScript.itemNameMapping); // column 位置初始化 this.node.y = this.gameModuleScript.itemSize; // 隨機初始化 item 圖片 for(let i=0;i{ + this.nowState = columnState.Spining; + this.gameModule.emit("AColumnStart", this.node.name); + this.t = 0; + }, this.spinCondition.delayTime); + + break; + case columnState.Delay: + cc.log("this is delay inside : " + this.node.name) // dev + break; case columnState.Spining: + case columnState.Slowing: + this.speedFactor = this.updateSpeedFactor(this.t); if(this.node.y - dY <= 0){ + //移動位置 this.node.y = this.node.y + this.gameModuleScript.itemSize - dY; - //更新圖片 - this.prepareNextItem(); - for(let i=0;i this.spinCondition.accelerateTime) && (this.nowState == columnState.Spining)) + {this.N -= 1;} + + // 減速階段會計數 M 值 + if(this.nowState == columnState.Slowing) this.M -= 1; + + // M小於3了,就出最終 item + if(this.M <= 3 && this.M > 0 && this.nowState == columnState.Slowing) { + a = this.finalList.pop(); + } + + // N歸零了,進到減速階段 + if(this.N == 0 && this.nowState == columnState.Spining) { + this.nowState = columnState.Slowing; + this.t = 0 + // 最終 item 結束,進到停止階段。 + } else if(this.finalList.length == 0) { + this.nowState = columnState.Stopping;} + + + this.currentList.unshift( a ); + this.currentList.pop(); + + for(let i=0;i this.spinCondition.accelerateTime)){ + result = 1; + }else if((this.nowState == columnState.Slowing)&&(t < this.spinCondition.slowdownTime)){ + result = 1 - ( Math.pow(t,2) / Math.pow(this.spinCondition.slowdownTime,2) ); + result = Math.pow(result,0.5); + }else{ + result = 0; + } + + return result; + } } diff --git a/assets/Script/engineerFunction.ts b/assets/Script/engineerFunction.ts index 2e6409b..6d3dfff 100644 --- a/assets/Script/engineerFunction.ts +++ b/assets/Script/engineerFunction.ts @@ -1,8 +1,8 @@ const {ccclass, property} = cc._decorator; -import {gameMY} from './gameModule'; -import {columnControl} from './columnControl'; +import {gameMY, moduleState, columnCondition} from './gameModule'; +import {columnControl, columnState} from './columnControl'; @@ -23,6 +23,14 @@ export default class NewClass extends cc.Component { private gameModuleScript; private columnControlScript; + spinCondition:columnCondition = { + finalResult:[3,2,1], + delayTime:100, + accelerateTime:0.5, + slowdownTime:0.5, + holdspeedTime:0.5, + N:2}; + protected onLoad () { cc.log("this is ee onLoad"); // 呼叫其他 script 的方法或資源 @@ -37,6 +45,7 @@ export default class NewClass extends cc.Component { protected start () { cc.log("this is ee start"); this.secCounter = 0; + // this.columnControlScript.spinCondition = this.spinCondition; } tempValue = true @@ -53,11 +62,28 @@ export default class NewClass extends cc.Component { } } - if(this.secCounter >= 5) { + // if(this.secCounter >= 5) { + // cc.log("engineer Function Update : " + this.fpsCount) + // this.secCounter = 0 + // this.fpsCount = 0 + // } + // cc.log(dt) + + if(this.test7on){ + + if(this.secCounter > 2){ + this.columnControlScript.nowState = columnState.Slowing; + this.secCounter = 0; + } + + let a = this.columnControlScript.updateSpeedFactor(this.secCounter); + cc.log("SF:" + a + ". T:" + this.secCounter); + + }else if(this.secCounter >= 5){ cc.log("engineer Function Update : " + this.fpsCount) this.secCounter = 0 this.fpsCount = 0 - } + } } @@ -77,12 +103,12 @@ export default class NewClass extends cc.Component { unitTest3():void { // @ts-ignore - this.itemList = Object.values(this.gameModuleScript.itemNameMapping) + this.itemPool = Object.values(this.gameModuleScript.itemNameMapping) for(let i=0;i{ + this.columnControlScript.nowState = columnState.Spining; + }, this.spinCondition.delayTime); + } + test7on:boolean = false; + test7():void { + this.test7on = !this.test7on; + this.secCounter = 0 + } + + + otherLoadingMethod(){ + + const symbol = { + 1: 'item_01', + 2: 'item_02', + 3: 'item_03', + 4: 'item_04', + 5: 'item_a', + 6: 'item_k', + 7: 'item_q', + 8: 'item_j', + 9: 'item_9', + 10: 'item_10', + 11: 'item_scatter', + 12: 'item_wild', + } + + const symbolSpriteList: Map = new Map() + + Object.keys(symbol).forEach((k, i) => { + cc.resources.load(`poker/cat/${symbol[k]}`, cc.SpriteFrame, (err, sp: cc.SpriteFrame) => { + symbolSpriteList.set(k, sp) + }) + }) + } diff --git a/assets/Script/gameModule.ts b/assets/Script/gameModule.ts index 3600ed5..7811b61 100644 --- a/assets/Script/gameModule.ts +++ b/assets/Script/gameModule.ts @@ -13,11 +13,23 @@ export enum moduleState { INIT1 = 0, INIT2 = 1, Ready = 2, - Spining = 3, - Stopping = 4, + SetSpin = 3, + Spining = 4, + Stopping = 5, }; +export interface columnCondition { + finalResult:Array; // 預期的最後結果 可為空 + delayTime:number; // 轉動前的延遲 單位 ms + accelerateTime:number; // 加速時間 單位 s + slowdownTime:number; // 減速時間 單位 s + holdspeedTime:number; // delete + N:number; // 持平速度的item數量 (-1 表示永動 需要手動停) + }; + + + @ccclass("gameMY") export class gameMY extends cc.Component { @@ -49,9 +61,14 @@ export class gameMY extends cc.Component { private balanceNumber: number; private bigFrameNumber: number; - private stopCount:number; + private isColumnSpin = {}; // 記錄各個 column 的是否旋轉 + private columnsID: Array = []; // 記錄各個 column 的 node name + + keepSpin:boolean = false; - nowState: moduleState = 0; + columnConditionList = {}; // 放置所有 column spin codition + + nowState: moduleState = moduleState.INIT1; // 狀態機 // item 圖片資源存放區 itemNameMapping = { @@ -63,23 +80,23 @@ export class gameMY extends cc.Component { item_spriteFrame = {}; itemBlur_spriteFrame = {}; - + protected onLoad () { this.unitTestInit(); // for engineer use - this.onColumnsSignal() + this.onColumnsSignal(); // 讀取 item 圖片資源 cc.resources.loadDir('item',cc.SpriteFrame, (err: any, sF) => { sF.forEach( (eachSpriteFrame)=>{ - this.item_spriteFrame[ this.itemNameMapping[eachSpriteFrame.name] ] = eachSpriteFrame + this.item_spriteFrame[ this.itemNameMapping[eachSpriteFrame.name] ] = eachSpriteFrame; }) } ); cc.resources.loadDir('item_blur',cc.SpriteFrame, (err: any, sF) => { sF.forEach( (eachSpriteFrame)=>{ - this.itemBlur_spriteFrame[ this.itemNameMapping[eachSpriteFrame.name] ] = eachSpriteFrame + this.itemBlur_spriteFrame[ this.itemNameMapping[eachSpriteFrame.name] ] = eachSpriteFrame; }) } ); @@ -90,15 +107,17 @@ export class gameMY extends cc.Component { protected start () { this.betNumber = 50; - this.slotBoard.addChild( cc.instantiate(this.columnPrefab), 1 ) - this.slotBoard.addChild( cc.instantiate(this.columnPrefab), 2 ) - this.slotBoard.addChild( cc.instantiate(this.columnPrefab), 3 ) - this.slotBoard.addChild( cc.instantiate(this.columnPrefab), 4 ) - + this.slotBoard.children[0].name = "0"; + this.slotBoard.addChild( cc.instantiate(this.columnPrefab), 1 , "1"); + this.slotBoard.addChild( cc.instantiate(this.columnPrefab), 2 , "2"); + this.slotBoard.addChild( cc.instantiate(this.columnPrefab), 3 , "3"); + this.slotBoard.addChild( cc.instantiate(this.columnPrefab), 4 , "4"); } protected update (dt) { + let isAnySpin:boolean = false; + let isAllSpin:boolean = true; switch(this.nowState){ case moduleState.INIT1: // 檢查圖片載入完成後 @@ -114,19 +133,45 @@ export class gameMY extends cc.Component { break; case moduleState.INIT2: for(let i=0; i{ + isAllSpin = isAllSpin && x; + }); + if(isAllSpin) { + this.nowState = moduleState.Spining; + // TODO: 避免重複使用 columnConditionList 應該適當處理 + } + break; case moduleState.Spining: - this.stopCount = 0; + Object.values(this.isColumnSpin).forEach((x:boolean)=>{ + isAnySpin = isAnySpin || x; + }); + if( !isAnySpin ){ + if(this.keepSpin){ + // get new condition + this.nowState = moduleState.SetSpin; + break; + }else{ + this.nowState = moduleState.Stopping; + } + } break; case moduleState.Stopping: - if(this.stopCount == 5){ - this.nowState = moduleState.Ready; - } + Object.values(this.isColumnSpin).forEach((x:boolean)=>{ + isAnySpin = isAnySpin || x; + }); + if( !isAnySpin ) this.nowState = moduleState.Ready; + break; default: break; @@ -144,16 +189,15 @@ export class gameMY extends cc.Component { else{ this.betNumber -= 50; } - this.betString.string = "" + this.betNumber + this.betString.string = "" + this.betNumber; } - onSpinBtnClick():void { switch(this.nowState){ case moduleState.Ready: - this.nowState = moduleState.Spining; + this.nowState = moduleState.SetSpin; break; case moduleState.Spining: this.nowState = moduleState.Stopping; @@ -166,9 +210,13 @@ export class gameMY extends cc.Component { } onColumnsSignal():void { - this.node.on('AColumnStop', ()=>{ - this.stopCount += 1; + this.node.on('AColumnStop', (ID)=>{ + this.isColumnSpin[ID] = false; }, this) + + this.node.on('AColumnStart',(ID)=>{ + this.isColumnSpin[ID] = true; + } ,this) } @@ -178,11 +226,23 @@ export class gameMY extends cc.Component { + simulateCondition():void { + for(let i=0; i{ - cc.log("gameModule Recieve Bob say " + arg1) + cc.log("gameModule Recieve Bob say " + arg1); }, this) }