Commit 687d2a78 authored by unknown's avatar unknown

数独加了一个还原按钮

parent 2b156c67
...@@ -24,17 +24,17 @@ ...@@ -24,17 +24,17 @@
"__id__": 7 "__id__": 7
}, },
{ {
"__id__": 123 "__id__": 138
} }
], ],
"_active": true, "_active": true,
"_components": [], "_components": [],
"_prefab": { "_prefab": {
"__id__": 126 "__id__": 141
}, },
"autoReleaseAssets": false, "autoReleaseAssets": false,
"_globals": { "_globals": {
"__id__": 127 "__id__": 142
}, },
"_id": "2fa5cb6f-32a4-47a2-afd9-b6c3532d1301" "_id": "2fa5cb6f-32a4-47a2-afd9-b6c3532d1301"
}, },
...@@ -214,22 +214,22 @@ ...@@ -214,22 +214,22 @@
"__id__": 16 "__id__": 16
}, },
{ {
"__id__": 93 "__id__": 108
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 116 "__id__": 131
}, },
{ {
"__id__": 118 "__id__": 133
}, },
{ {
"__id__": 120 "__id__": 135
}, },
{ {
"__id__": 122 "__id__": 137
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -511,15 +511,18 @@ ...@@ -511,15 +511,18 @@
}, },
{ {
"__id__": 49 "__id__": 49
},
{
"__id__": 91
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 91 "__id__": 106
}, },
{ {
"__id__": 92 "__id__": 107
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -2479,6 +2482,384 @@ ...@@ -2479,6 +2482,384 @@
"checkEvents": [], "checkEvents": [],
"_id": "f8VCYPJn5P/IgyA7Hf4u6C" "_id": "f8VCYPJn5P/IgyA7Hf4u6C"
}, },
{
"__type__": "cc.Node",
"_name": "resetBtn",
"_objFlags": 0,
"_parent": {
"__id__": 16
},
"_children": [
{
"__id__": 92
},
{
"__id__": 97
}
],
"_active": true,
"_components": [
{
"__id__": 102
},
{
"__id__": 104
}
],
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 267.296,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": "ddGTVqX7xK06DbIsTA57pu"
},
{
"__type__": "cc.Node",
"_name": "bgSpr",
"_objFlags": 0,
"_parent": {
"__id__": 91
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 93
},
{
"__id__": 95
}
],
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": "f67MCCHo5DR5svcTr+lria"
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 92
},
"_enabled": true,
"__prefab": {
"__id__": 94
},
"_contentSize": {
"__type__": "cc.Size",
"width": 120,
"height": 60
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": "513JKg+9FLgaZhe2vPZpBJ"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "55pCbtzR5GbojKMArZkfim"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 92
},
"_enabled": true,
"__prefab": {
"__id__": 96
},
"_visFlags": 0,
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 30,
"g": 37,
"b": 51,
"a": 255
},
"_spriteFrame": {
"__uuid__": "7d8f9b89-4fd1-4c9f-a3ab-38ec7cded7ca@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": "b7UjZhY9BND5Jdk60NONGg"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "20UGQn4U9GUoln0NJQTkbG"
},
{
"__type__": "cc.Node",
"_name": "Label",
"_objFlags": 0,
"_parent": {
"__id__": 91
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 98
},
{
"__id__": 100
}
],
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": "440KQzOu1Ljrhxql925qpl"
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 97
},
"_enabled": true,
"__prefab": {
"__id__": 99
},
"_contentSize": {
"__type__": "cc.Size",
"width": 80,
"height": 50.4
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": "baqsCMMZZHmIxQo7goLctk"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "c68UOAlNhN171Umca6yVvF"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 97
},
"_enabled": true,
"__prefab": {
"__id__": 101
},
"_visFlags": 0,
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_string": "还原",
"_horizontalAlign": 1,
"_verticalAlign": 1,
"_actualFontSize": 40,
"_fontSize": 40,
"_fontFamily": "Arial",
"_lineHeight": 40,
"_overflow": 0,
"_enableWrapText": true,
"_font": null,
"_isSystemFontUsed": true,
"_isItalic": false,
"_isBold": false,
"_isUnderline": false,
"_underlineHeight": 2,
"_cacheMode": 0,
"_id": "12/xFMS9FMAYaLFJODdFt5"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "2frm37uaJHQr0AEEaYyM82"
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 91
},
"_enabled": true,
"__prefab": {
"__id__": 103
},
"_contentSize": {
"__type__": "cc.Size",
"width": 120,
"height": 60
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": "acl2DGFR1BoaJ0ScPCKE1r"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "55pCbtzR5GbojKMArZkfim"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 91
},
"_enabled": true,
"__prefab": null,
"clickEvents": [
{
"__id__": 105
}
],
"_interactable": true,
"_transition": 3,
"_normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_hoverColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_pressedColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_normalSprite": null,
"_hoverSprite": null,
"_pressedSprite": null,
"_disabledSprite": null,
"_duration": 0.1,
"_zoomScale": 0.85,
"_target": null,
"_id": "94I6fn/dJLvr/8aPcbwy1b"
},
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 7
},
"component": "",
"_componentId": "028ac43h3tHd4EX1Yzc4tdg",
"handler": "onResetBtn",
"customEventData": ""
},
{ {
"__type__": "cc.UITransform", "__type__": "cc.UITransform",
"_name": "", "_name": "",
...@@ -2538,22 +2919,22 @@ ...@@ -2538,22 +2919,22 @@
}, },
"_children": [ "_children": [
{ {
"__id__": 94 "__id__": 109
}, },
{ {
"__id__": 100 "__id__": 115
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 111 "__id__": 126
}, },
{ {
"__id__": 113 "__id__": 128
}, },
{ {
"__id__": 115 "__id__": 130
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -2590,19 +2971,19 @@ ...@@ -2590,19 +2971,19 @@
"_name": "名称框", "_name": "名称框",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 93 "__id__": 108
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 95 "__id__": 110
}, },
{ {
"__id__": 97 "__id__": 112
}, },
{ {
"__id__": 99 "__id__": 114
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -2639,11 +3020,11 @@ ...@@ -2639,11 +3020,11 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 94 "__id__": 109
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 96 "__id__": 111
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
...@@ -2666,11 +3047,11 @@ ...@@ -2666,11 +3047,11 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 94 "__id__": 109
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 98 "__id__": 113
}, },
"_visFlags": 0, "_visFlags": 0,
"_customMaterial": null, "_customMaterial": null,
...@@ -2711,15 +3092,15 @@ ...@@ -2711,15 +3092,15 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 94 "__id__": 109
}, },
"_enabled": true, "_enabled": true,
"__prefab": null, "__prefab": null,
"_alignFlags": 8, "_alignFlags": 9,
"_target": null, "_target": null,
"_left": 10, "_left": 10,
"_right": 0, "_right": 0,
"_top": 0, "_top": 15.5,
"_bottom": 0, "_bottom": 0,
"_horizontalCenter": 0, "_horizontalCenter": 0,
"_verticalCenter": 0, "_verticalCenter": 0,
...@@ -2740,23 +3121,23 @@ ...@@ -2740,23 +3121,23 @@
"_name": "时间框", "_name": "时间框",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 93 "__id__": 108
}, },
"_children": [ "_children": [
{ {
"__id__": 101 "__id__": 116
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 106 "__id__": 121
}, },
{ {
"__id__": 108 "__id__": 123
}, },
{ {
"__id__": 110 "__id__": 125
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -2793,16 +3174,16 @@ ...@@ -2793,16 +3174,16 @@
"_name": "timeLab", "_name": "timeLab",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 100 "__id__": 115
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 102 "__id__": 117
}, },
{ {
"__id__": 104 "__id__": 119
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -2839,11 +3220,11 @@ ...@@ -2839,11 +3220,11 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 101 "__id__": 116
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 103 "__id__": 118
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
...@@ -2866,11 +3247,11 @@ ...@@ -2866,11 +3247,11 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 101 "__id__": 116
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 105 "__id__": 120
}, },
"_visFlags": 0, "_visFlags": 0,
"_customMaterial": null, "_customMaterial": null,
...@@ -2910,11 +3291,11 @@ ...@@ -2910,11 +3291,11 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 100 "__id__": 115
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 107 "__id__": 122
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
...@@ -2937,11 +3318,11 @@ ...@@ -2937,11 +3318,11 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 100 "__id__": 115
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 109 "__id__": 124
}, },
"_visFlags": 0, "_visFlags": 0,
"_customMaterial": null, "_customMaterial": null,
...@@ -2982,15 +3363,15 @@ ...@@ -2982,15 +3363,15 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 100 "__id__": 115
}, },
"_enabled": true, "_enabled": true,
"__prefab": null, "__prefab": null,
"_alignFlags": 32, "_alignFlags": 33,
"_target": null, "_target": null,
"_left": 0, "_left": 0,
"_right": 15, "_right": 15,
"_top": 0, "_top": 15.5,
"_bottom": 0, "_bottom": 0,
"_horizontalCenter": 0, "_horizontalCenter": 0,
"_verticalCenter": 0, "_verticalCenter": 0,
...@@ -3011,11 +3392,11 @@ ...@@ -3011,11 +3392,11 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 93 "__id__": 108
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 112 "__id__": 127
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
...@@ -3038,11 +3419,11 @@ ...@@ -3038,11 +3419,11 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 93 "__id__": 108
}, },
"_enabled": false, "_enabled": false,
"__prefab": { "__prefab": {
"__id__": 114 "__id__": 129
}, },
"_resizeMode": 1, "_resizeMode": 1,
"_layoutType": 1, "_layoutType": 1,
...@@ -3075,7 +3456,7 @@ ...@@ -3075,7 +3456,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 93 "__id__": 108
}, },
"_enabled": true, "_enabled": true,
"__prefab": null, "__prefab": null,
...@@ -3108,7 +3489,7 @@ ...@@ -3108,7 +3489,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 117 "__id__": 132
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
...@@ -3135,7 +3516,7 @@ ...@@ -3135,7 +3516,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 119 "__id__": 134
}, },
"_cameraComponent": { "_cameraComponent": {
"__id__": 9 "__id__": 9
...@@ -3156,7 +3537,7 @@ ...@@ -3156,7 +3537,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 121 "__id__": 136
}, },
"_alignFlags": 45, "_alignFlags": 45,
"_target": null, "_target": null,
...@@ -3195,7 +3576,7 @@ ...@@ -3195,7 +3576,7 @@
"__id__": 22 "__id__": 22
}, },
"countdownLab": { "countdownLab": {
"__id__": 104 "__id__": 119
}, },
"remainLab": { "remainLab": {
"__id__": 20 "__id__": 20
...@@ -3214,10 +3595,10 @@ ...@@ -3214,10 +3595,10 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 124 "__id__": 139
}, },
{ {
"__id__": 125 "__id__": 140
} }
], ],
"_prefab": null, "_prefab": null,
...@@ -3254,7 +3635,7 @@ ...@@ -3254,7 +3635,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 123 "__id__": 138
}, },
"_enabled": true, "_enabled": true,
"__prefab": null, "__prefab": null,
...@@ -3269,12 +3650,12 @@ ...@@ -3269,12 +3650,12 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 123 "__id__": 138
}, },
"_enabled": true, "_enabled": true,
"__prefab": null, "__prefab": null,
"audioSource": { "audioSource": {
"__id__": 124 "__id__": 139
}, },
"_id": "43XyqKQo1PPp8jStX535Q5" "_id": "43XyqKQo1PPp8jStX535Q5"
}, },
...@@ -3286,16 +3667,16 @@ ...@@ -3286,16 +3667,16 @@
{ {
"__type__": "cc.SceneGlobals", "__type__": "cc.SceneGlobals",
"ambient": { "ambient": {
"__id__": 128 "__id__": 143
}, },
"shadows": { "shadows": {
"__id__": 129 "__id__": 144
}, },
"_skybox": { "_skybox": {
"__id__": 130 "__id__": 145
}, },
"fog": { "fog": {
"__id__": 131 "__id__": 146
} }
}, },
{ {
......
...@@ -67,6 +67,10 @@ export class SudokuCtr extends Component { ...@@ -67,6 +67,10 @@ export class SudokuCtr extends Component {
this.gameStart(); this.gameStart();
} }
onResetBtn(){
director.emit("resetItem");
}
onDestroy() { onDestroy() {
director.off("sk_item_click", this.onItemClick, this); director.off("sk_item_click", this.onItemClick, this);
director.off("begin_countdown_end"); director.off("begin_countdown_end");
......
...@@ -35,8 +35,22 @@ export class SudokuItemCtr extends Component { ...@@ -35,8 +35,22 @@ export class SudokuItemCtr extends Component {
} }
onItemClick() { onItemClick() {
if (this.itemType == SK_ITEM_TYPE.INVARIABLE) return; // if (this.itemType == SK_ITEM_TYPE.INVARIABLE) return;
director.emit("sk_item_click", this); director.emit("sk_item_click", this);
director.on("resetItem", this.resetItem, this);
}
resetItem() {
if (this.itemType == SK_ITEM_TYPE.INVARIABLE) {
this.numLab.string = this.rightNumStr;
}
else {
this.numLab.string = "";
}
}
onDestroy() {
director.off("resetItem", this.resetItem, this);
} }
getItemType() { getItemType() {
...@@ -60,14 +74,14 @@ export class SudokuItemCtr extends Component { ...@@ -60,14 +74,14 @@ export class SudokuItemCtr extends Component {
this.setNumStr(numStr); this.setNumStr(numStr);
this.rightNumStr = numStr; this.rightNumStr = numStr;
this.bgSpr.color = color; this.bgSpr.color = color;
if(type == SK_ITEM_TYPE.VARIABLE){ if (type == SK_ITEM_TYPE.VARIABLE) {
this.setNumStr(""); this.setNumStr("");
} }
this.posIfo = posIfo; this.posIfo = posIfo;
this.posIfo.target = this.node; this.posIfo.target = this.node;
} }
isRight(){ isRight() {
return this.numLab.string == this.rightNumStr; return this.numLab.string == this.rightNumStr;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment