Commit b930a813 authored by unknown's avatar unknown

邻接数组好了

parent 18642d0e
{
"ver": "1.0.21",
"importer": "image",
"imported": true,
"uuid": "46dc415a-025e-482a-8b9d-7afed35c78a2",
"files": [
".png",
".json"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "46dc415a-025e-482a-8b9d-7afed35c78a2@6c48a",
"displayName": "名称框",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0,
"isUuid": true,
"imageUuidOrDatabaseUri": "46dc415a-025e-482a-8b9d-7afed35c78a2"
},
"ver": "1.0.21",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "46dc415a-025e-482a-8b9d-7afed35c78a2@f9941",
"displayName": "名称框",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 262,
"height": 69,
"rawWidth": 262,
"rawHeight": 69,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"isUuid": true,
"imageUuidOrDatabaseUri": "46dc415a-025e-482a-8b9d-7afed35c78a2@6c48a",
"atlasUuid": ""
},
"ver": "1.0.9",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"hasAlpha": true,
"type": "sprite-frame",
"redirect": "46dc415a-025e-482a-8b9d-7afed35c78a2@f9941"
}
}
......@@ -29,7 +29,7 @@
"_prefab": null,
"autoReleaseAssets": false,
"_globals": {
"__id__": 38
"__id__": 79
},
"_id": "2125b048-7251-4266-a7f6-5514056e724c"
},
......@@ -207,21 +207,27 @@
},
{
"__id__": 16
},
{
"__id__": 31
},
{
"__id__": 54
}
],
"_active": true,
"_components": [
{
"__id__": 31
"__id__": 72
},
{
"__id__": 33
"__id__": 74
},
{
"__id__": 35
"__id__": 76
},
{
"__id__": 37
"__id__": 78
}
],
"_prefab": null,
......@@ -309,7 +315,7 @@
"_priority": 1073741824,
"_fov": 45,
"_fovAxis": 0,
"_orthoHeight": 483.7993273542601,
"_orthoHeight": 478.5819209039548,
"_near": 1,
"_far": 2000,
"_color": {
......@@ -935,70 +941,197 @@
"_lockFlags": 0,
"_id": "3fxnA6gEJKpY8fGoW2zHkT"
},
{
"__type__": "cc.Node",
"_name": "Layout",
"_objFlags": 0,
"_parent": {
"__id__": 7
},
"_children": [
{
"__id__": 32
},
{
"__id__": 38
}
],
"_active": true,
"_components": [
{
"__id__": 49
},
{
"__id__": 51
},
{
"__id__": 53
}
],
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 325,
"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": "551DLJBcZPjbSD2WZb5d0/"
},
{
"__type__": "cc.Node",
"_name": "名称框",
"_objFlags": 0,
"_parent": {
"__id__": 31
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 33
},
{
"__id__": 35
},
{
"__id__": 37
}
],
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": -526,
"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": "47RmrV02NEqpBWNX0UH7Nd"
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
"__id__": 32
},
"_enabled": true,
"__prefab": {
"__id__": 32
"__id__": 34
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1334,
"height": 750
"width": 262,
"height": 69
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": "3eL0u28KBICZnbnrlZFpiC"
"_id": "f5/O5sM3ZKv44hjfqekG/C"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "0dngp/9gNO34wUQjZfN/CX"
"fileId": "f7NISe7HdAD68SLfhnddy8"
},
{
"__type__": "cc.Canvas",
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
"__id__": 32
},
"_enabled": true,
"__prefab": {
"__id__": 34
"__id__": 36
},
"_cameraComponent": {
"__id__": 9
"_visFlags": 0,
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_alignCanvasWithScreen": true,
"_id": "caViSRjR9OOYx1jZWqohZH"
"_spriteFrame": {
"__uuid__": "46dc415a-025e-482a-8b9d-7afed35c78a2@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 1,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": "fbJb3K3UJP8Yg1oJbDCJiC"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "3f2oTdCepERZdpmIfLsrhd"
"fileId": "e71ctEmpxFC4KlSYRZNz/a"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
"__id__": 32
},
"_enabled": true,
"__prefab": {
"__id__": 36
},
"_alignFlags": 45,
"__prefab": null,
"_alignFlags": 9,
"_target": null,
"_left": 0,
"_left": 10,
"_right": 0,
"_top": 0,
"_top": 15.5,
"_bottom": 0,
"_horizontalCenter": 0,
"_verticalCenter": 0,
......@@ -1012,55 +1145,922 @@
"_originalHeight": 0,
"_alignMode": 2,
"_lockFlags": 0,
"_id": "feZYdO0YtOk55vd5HQB7AX"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "e8a+bU/8dPDbbJguUzLdoF"
"_id": "43morBy6VJpJ7FwZAwSCoT"
},
{
"__type__": "89d77e7UWtKa7FAqNdc14hS",
"_name": "",
"__type__": "cc.Node",
"_name": "时间框",
"_objFlags": 0,
"node": {
"__id__": 7
},
"_enabled": true,
"__prefab": null,
"itemPosArrNode": {
"__id__": 26
"_parent": {
"__id__": 31
},
"gridArrNode": {
"__id__": 23
"_children": [
{
"__id__": 39
}
],
"_active": true,
"_components": [
{
"__id__": 44
},
{
"__id__": 46
},
{
"__id__": 48
}
],
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": 464,
"y": 0,
"z": 0
},
"bottomSprNode": {
"__id__": 17
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"itemPre": {
"__uuid__": "69f70b78-4aed-4f84-b360-9e0dc59da4f7",
"__expectedType__": "cc.Prefab"
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"gridPre": {
"__uuid__": "d02f07b8-737a-4b88-b0b5-702256fe7f06",
"__expectedType__": "cc.Prefab"
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"countdownLab": null,
"totalTime": 0,
"_id": "17m3iEoEhL27CwezZv9cwb"
"_id": "c4zhZgOzNG0YZhB8iC4Oxk"
},
{
"__type__": "cc.SceneGlobals",
"ambient": {
"__id__": 39
"__type__": "cc.Node",
"_name": "timeLab",
"_objFlags": 0,
"_parent": {
"__id__": 38
},
"shadows": {
"__id__": 40
"_children": [],
"_active": true,
"_components": [
{
"__id__": 40
},
{
"__id__": 42
}
],
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": 94.847,
"y": 0,
"z": 0
},
"_skybox": {
"__id__": 41
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"fog": {
"__id__": 42
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": "15D7hI87FNbojoqZnLW1D5"
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 39
},
"_enabled": true,
"__prefab": {
"__id__": 41
},
"_contentSize": {
"__type__": "cc.Size",
"width": 100.1,
"height": 50.4
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": "8dkvH8qP5KvLbuci26AWss"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "c68UOAlNhN171Umca6yVvF"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 39
},
"_enabled": true,
"__prefab": {
"__id__": 43
},
"_visFlags": 0,
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_string": "00:00",
"_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": "65IduDPIpKOLPcxJdBInvw"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "2frm37uaJHQr0AEEaYyM82"
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 38
},
"_enabled": true,
"__prefab": {
"__id__": 45
},
"_contentSize": {
"__type__": "cc.Size",
"width": 376,
"height": 69
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": "665AGV5fxKgpI7wA9r+s6R"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "f7NISe7HdAD68SLfhnddy8"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 38
},
"_enabled": true,
"__prefab": {
"__id__": 47
},
"_visFlags": 0,
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "883de798-5814-4177-8223-4703908d0a54@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 1,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": "a9P2T4YY1HaZkjwRKkngJG"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "e71ctEmpxFC4KlSYRZNz/a"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 38
},
"_enabled": true,
"__prefab": null,
"_alignFlags": 33,
"_target": null,
"_left": 0,
"_right": 15,
"_top": 15.5,
"_bottom": 0,
"_horizontalCenter": 0,
"_verticalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_alignMode": 2,
"_lockFlags": 0,
"_id": "62Q0rOGAlOoKA2Z3HtPhYP"
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 31
},
"_enabled": true,
"__prefab": {
"__id__": 50
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1334,
"height": 100
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": "6dtE4o/ZFEmJFQ2ysF/qR4"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "71F9vsVsZH7ZFd+PpN0azA"
},
{
"__type__": "cc.Layout",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 31
},
"_enabled": false,
"__prefab": {
"__id__": 52
},
"_resizeMode": 1,
"_layoutType": 1,
"_cellSize": {
"__type__": "cc.Size",
"width": 40,
"height": 40
},
"_startAxis": 0,
"_paddingLeft": 0,
"_paddingRight": 0,
"_paddingTop": 0,
"_paddingBottom": 0,
"_spacingX": 0,
"_spacingY": 0,
"_verticalDirection": 1,
"_horizontalDirection": 0,
"_constraint": 0,
"_constraintNum": 2,
"_affectedByScale": false,
"_isAlign": false,
"_id": "096C6PMrFDOJcftWHmphlz"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "eaGEkmlCpANK+GS6CImtZa"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 31
},
"_enabled": true,
"__prefab": null,
"_alignFlags": 41,
"_target": null,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_horizontalCenter": 0,
"_verticalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 1334,
"_originalHeight": 0,
"_alignMode": 2,
"_lockFlags": 0,
"_id": "a8T8Vu1tZPsaIbS3tBmo/5"
},
{
"__type__": "cc.Node",
"_name": "gameDescBtn",
"_objFlags": 0,
"_parent": {
"__id__": 7
},
"_children": [
{
"__id__": 55
},
{
"__id__": 60
}
],
"_active": true,
"_components": [
{
"__id__": 65
},
{
"__id__": 67
},
{
"__id__": 69
}
],
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": 527.627,
"y": 211.904,
"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": "0arirwGINMiLtHID7gUkeP"
},
{
"__type__": "cc.Node",
"_name": "bgSpr",
"_objFlags": 0,
"_parent": {
"__id__": 54
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 56
},
{
"__id__": 58
}
],
"_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": "eepxFSAy1Or7/hNidBdNWm"
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 55
},
"_enabled": true,
"__prefab": {
"__id__": 57
},
"_contentSize": {
"__type__": "cc.Size",
"width": 160,
"height": 60
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": "dfcpxmMv5DVoEAJQ4g09PK"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "55pCbtzR5GbojKMArZkfim"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 55
},
"_enabled": true,
"__prefab": {
"__id__": 59
},
"_visFlags": 0,
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 120
},
"_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": "e6wOp+zjZDM5GxzWXKFtR/"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "20UGQn4U9GUoln0NJQTkbG"
},
{
"__type__": "cc.Node",
"_name": "Label",
"_objFlags": 0,
"_parent": {
"__id__": 54
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 61
},
{
"__id__": 63
}
],
"_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": "3beOUpAVBOOZfiCGyHl/Qo"
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 60
},
"_enabled": true,
"__prefab": {
"__id__": 62
},
"_contentSize": {
"__type__": "cc.Size",
"width": 128,
"height": 50.4
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": "5bxbXAikFJTbIRGyBZOWIk"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "c68UOAlNhN171Umca6yVvF"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 60
},
"_enabled": true,
"__prefab": {
"__id__": 64
},
"_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": 32,
"_fontSize": 32,
"_fontFamily": "Arial",
"_lineHeight": 40,
"_overflow": 0,
"_enableWrapText": true,
"_font": null,
"_isSystemFontUsed": true,
"_isItalic": false,
"_isBold": false,
"_isUnderline": false,
"_underlineHeight": 2,
"_cacheMode": 0,
"_id": "463mhahzpBx7SYf25znGzM"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "2frm37uaJHQr0AEEaYyM82"
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 54
},
"_enabled": true,
"__prefab": {
"__id__": 66
},
"_contentSize": {
"__type__": "cc.Size",
"width": 160,
"height": 60
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": "063gcSJTpGxqKCzNnyaotT"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "30AFpV6rhJLKJMbjqrvDLm"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 54
},
"_enabled": true,
"__prefab": {
"__id__": 68
},
"_alignFlags": 33,
"_target": null,
"_left": 0,
"_right": 59.37300000000005,
"_top": 133.096,
"_bottom": 0,
"_horizontalCenter": 0,
"_verticalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_alignMode": 2,
"_lockFlags": 0,
"_id": "f5YElsgVhHyoR+Z/9+jUGH"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "ebKiXA481GJaVCm3yUMRB/"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 54
},
"_enabled": true,
"__prefab": {
"__id__": 70
},
"clickEvents": [
{
"__id__": 71
}
],
"_interactable": true,
"_transition": 0,
"_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": 1.2,
"_target": null,
"_id": "d1HHbD1XZIVY6tnYhl8UfA"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "fasaRsl0VPiqKt+O6/ppa2"
},
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 7
},
"component": "",
"_componentId": "89d77e7UWtKa7FAqNdc14hS",
"handler": "showGameDescView",
"customEventData": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
},
"_enabled": true,
"__prefab": {
"__id__": 73
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1334,
"height": 750
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": "3eL0u28KBICZnbnrlZFpiC"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "0dngp/9gNO34wUQjZfN/CX"
},
{
"__type__": "cc.Canvas",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
},
"_enabled": true,
"__prefab": {
"__id__": 75
},
"_cameraComponent": {
"__id__": 9
},
"_alignCanvasWithScreen": true,
"_id": "caViSRjR9OOYx1jZWqohZH"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "3f2oTdCepERZdpmIfLsrhd"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
},
"_enabled": true,
"__prefab": {
"__id__": 77
},
"_alignFlags": 45,
"_target": null,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_horizontalCenter": 0,
"_verticalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_alignMode": 2,
"_lockFlags": 0,
"_id": "feZYdO0YtOk55vd5HQB7AX"
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "e8a+bU/8dPDbbJguUzLdoF"
},
{
"__type__": "89d77e7UWtKa7FAqNdc14hS",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
},
"_enabled": true,
"__prefab": null,
"itemPosArrNode": {
"__id__": 26
},
"gridArrNode": {
"__id__": 23
},
"bottomSprNode": {
"__id__": 17
},
"itemPre": {
"__uuid__": "69f70b78-4aed-4f84-b360-9e0dc59da4f7",
"__expectedType__": "cc.Prefab"
},
"gridPre": {
"__uuid__": "d02f07b8-737a-4b88-b0b5-702256fe7f06",
"__expectedType__": "cc.Prefab"
},
"countdownLab": {
"__id__": 42
},
"totalTime": 30,
"_id": "17m3iEoEhL27CwezZv9cwb"
},
{
"__type__": "cc.SceneGlobals",
"ambient": {
"__id__": 80
},
"shadows": {
"__id__": 81
},
"_skybox": {
"__id__": 82
},
"fog": {
"__id__": 83
}
},
{
......
import { _decorator, Component, Node } from 'cc';
const { ccclass, property } = _decorator;
export const adjacentArrayLV_1: number[][] = [
[1, 0, 0, 3],
[2, 3, 2, 1],
[3, 3, 0, 3],
[2, 1, 1, 2]
];
export const adjacentArrayLV_2: number[][] = [
[1, 0, 0, 3],
[2, 3, 2, 1],
[3, 3, 0, 3],
[3, 1, 1, 2],
[2, 2, 1, 1]
];
\ No newline at end of file
{
"ver": "4.0.22",
"importer": "typescript",
"imported": true,
"uuid": "5cb4c21e-2428-4549-8b22-47a9e1286ec6",
"files": [],
"subMetas": {},
"userData": {}
}
import { _decorator, Component, Node, Vec3, v3, Prefab, Label, CCFloat, instantiate, UITransform, SpriteFrame, Sprite, Color, EventTouch } from 'cc';
import { _decorator, Component, Node, Vec3, v3, Prefab, Label, CCFloat, instantiate, UITransform, SpriteFrame, Sprite, Color, EventTouch, director } from 'cc';
import { countdownMus, failMus, succMus } from '../../../../startFolder/script/common/AudioDef';
import { AudioMgr } from '../../../../startFolder/script/common/AudioMgr';
import { Utils } from '../../../../startFolder/script/common/Utils';
import { VIEW_DEF } from '../../../../startFolder/script/common/ViewDef';
import { viewMgr, VIEW_INDEX } from '../../../../startFolder/script/common/ViewMgr';
import { BeginCountdownView } from '../../commonView/script/BeginCountdownView';
import { ChallengeSuccView } from '../../commonView/script/ChallengeSuccView';
import { GameDescView } from '../../commonView/script/GameDescView';
import { adjacentArrayLV_1, adjacentArrayLV_2 } from './AdjacentArrayCfg';
import { AdjacentArrayItemCtr } from './AdjacentArrayItemCtr';
const { ccclass, property } = _decorator;
......@@ -18,6 +27,13 @@ export interface GridIfo {
clickNode: Node,
}
enum GAME_STATE {
READY = 10,
PAUSE = 20,
END = 30,
RUN = 40,
}
@ccclass('AdjacentArrayCtr')
export class AdjacentArrayCtr extends Component {
......@@ -51,34 +67,112 @@ export class AdjacentArrayCtr extends Component {
private row = 5;
private column = 6;
private gridIfoArr: GridIfo[] = [];
private levelData: number[][] = [];
private level = 0;
private gameState: GAME_STATE = GAME_STATE.READY;
private costTime = 0;
private isPlayCountdownMus = false;
private isShowGameDescViewOnce = false;
showGameDescView() {
this.isShowGameDescViewOnce = true;
viewMgr.openView(VIEW_DEF.GameDescView, (node) => {
node.getComponent(GameDescView)?.setDesc("点击两个数字中间的空格将两个数字合并成一个,\n当所有数字都两两组合完成时,没有重复的数字就算成功。\n注:点击两个已经组合的数字可以将其分开。");
});
}
onCloseGameDescView() {
this.gameState = GAME_STATE.RUN;
}
setGameData(resData: object) {
//@ts-ignore
if (resData.totalTime) {
//@ts-ignore
this.totalTime = resData.totalTime;
}
//@ts-ignore
if (resData.level) {
//@ts-ignore
this.level = resData.level;
}
//@ts-ignore
if (resData.isShowGuide) {
//@ts-ignore
this.isShowGameDescViewOnce = false;
}
else {
this.isShowGameDescViewOnce = true;
}
}
start() {
// [3]
director.on("begin_countdown_end", () => {
//引导
if (!this.isShowGameDescViewOnce) {
this.gameState = GAME_STATE.PAUSE;
this.showGameDescView();
}
else {
this.gameState = GAME_STATE.RUN;
}
}, this);
director.on("game_desc_close", this.onCloseGameDescView, this);
this.gameStart();
}
onDestroy() {
director.off("begin_countdown_end");
director.off("game_desc_close", this.onCloseGameDescView, this);
}
gameStart() {
this.countdownLab.string = Utils.formatTime(Math.floor(this.totalTime * 1000));
this.gameState = GAME_STATE.READY;
this.loadLevelData();
this.itemPosArrNode.destroyAllChildren();
this.gridArrNode.destroyAllChildren();
this.creAllItem();
this.setBgSprSize();
this.creAllGrid();
viewMgr.openView(VIEW_DEF.BeginCountdownView, (node) => {
node.getComponent(BeginCountdownView)?.init();
}, VIEW_INDEX.UPPER);
// this.gameState = GAME_STATE.RUN;
}
gameEnd(isWin: boolean) {
this.gameState = GAME_STATE.END;
if (isWin) {
viewMgr.openView(VIEW_DEF.ChallengeSuccView, (node) => {
AudioMgr.playOneShot(succMus);
node?.getComponent(ChallengeSuccView)?.init();
}, VIEW_INDEX.TOP);
}
else {
viewMgr.openView(VIEW_DEF.ChallengeFailView, (node) => {
AudioMgr.playOneShot(failMus);
}, VIEW_INDEX.TOP);
}
}
onGridClick(event: EventTouch) {
console.log(`grid被点击`);
console.log(event.target)
// console.log(`grid被点击`);
// console.log(event.target)
let grid = this.findGridInGridArr(<Node>event.target)!;
grid.active = !grid.active;
if (grid.active) {
console.log(`选中格子`);
console.log(grid.gridItem);
// console.log(`选中格子`);
// console.log(grid.gridItem);
//先去掉
let o_gridArr = this.findGridInGridArrWithItem(grid.pairItem[0]);
o_gridArr = o_gridArr.concat(this.findGridInGridArrWithItem(grid.pairItem[1]));
for (let i = 0; i < o_gridArr.length; ++i) {
if(!o_gridArr[i].active) continue;
if (!o_gridArr[i].active) continue;
o_gridArr[i].active = false;
o_gridArr[i].gridItem.active = false;
o_gridArr[i].pairItem[0].target.getComponent(AdjacentArrayItemCtr)?.setBgSprToNor();
......@@ -93,23 +187,58 @@ export class AdjacentArrayCtr extends Component {
else {
grid.gridItem.active = false;
grid.active = false;
console.log(`选中格子`);
console.log(grid.gridItem);
// console.log(`选中格子`);
// console.log(grid.gridItem);
grid.pairItem[0].target.getComponent(AdjacentArrayItemCtr)?.setBgSprToNor();
grid.pairItem[1].target.getComponent(AdjacentArrayItemCtr)?.setBgSprToNor();
}
//检测是否成功
if (this.checkWin()) {
console.log(`成功了`);
this.gameEnd(true);
}
else {
console.log(`没有成功`);
}
}
creAllItem() {
let numArr: number[] = [];
for(let i = 0; i < this.levelData.length; ++ i){
numArr = numArr.concat(this.levelData[i]);
}
this.itemPosIfoArr = this.getSqPosIfoArr(this.row, this.column, this.itemWidth, this.itemHeight, this.itemSpaceX, this.itemSpaceY);
for (let i = 0; i < this.itemPosIfoArr.length; ++i) {
let node = instantiate(this.itemPre);
this.itemPosArrNode.addChild(node);
node.setPosition(this.itemPosIfoArr[i].pos);
this.itemPosIfoArr[i].target = node;
node.getComponent(AdjacentArrayItemCtr)?.setNum(numArr[i]);
}
}
checkWin() {
let numStrArr: string[] = [];
for (let i = 0; i < this.gridIfoArr.length; ++i) {
let f_num = this.gridIfoArr[i].pairItem[0].target.getComponent(AdjacentArrayItemCtr)!.getNum();
let s_num = this.gridIfoArr[i].pairItem[1].target.getComponent(AdjacentArrayItemCtr)!.getNum();
if (this.gridIfoArr[i].active) {
numStrArr.push(`${f_num}${s_num}`);
}
}
if (numStrArr.length < this.row * this.column / 2) return false;
let repeatSet: Set<string> = new Set<string>();
for (let i = 0; i < numStrArr.length; ++i) {
if (repeatSet.has(numStrArr[i])) {
return false;
}
else {
repeatSet.add(numStrArr[i]);
}
}
return true;
}
setBgSprSize() {
let minWidth = this.column * this.itemWidth + (this.column - 1) * this.itemSpaceX;
let minHeight = this.row * this.itemHeight + (this.row - 1) * this.itemSpaceY;
......@@ -233,7 +362,39 @@ export class AdjacentArrayCtr extends Component {
return items;
}
// update (deltaTime: number) {
// // [4]
// }
loadLevelData() {
switch (this.level) {
case 1:
this.levelData = adjacentArrayLV_1;
break;
default:
this.levelData = adjacentArrayLV_2;
break;
}
this.row = this.levelData.length;
this.column = this.levelData[0].length;
}
//倒计时
countdownTime(dt: number) {
if (this.gameState == GAME_STATE.READY || this.gameState == GAME_STATE.END || this.gameState == GAME_STATE.PAUSE) {
return;
}
this.costTime += dt;
if (!this.isPlayCountdownMus && this.totalTime - this.costTime < 3.5) {
this.isPlayCountdownMus = true;
AudioMgr.playOneShot(countdownMus);
}
if (this.totalTime - this.costTime <= 0) {
console.log(`游戏时间到`);
this.gameEnd(false);
return;
}
this.countdownLab.string = Utils.formatTime(Math.floor((this.totalTime - this.costTime) * 1000));
}
update (deltaTime: number) {
// [4]
this.countdownTime(deltaTime);
}
}
\ No newline at end of file
......@@ -11,6 +11,8 @@ export class AdjacentArrayItemCtr extends Component {
@property(Label)
numLab: Label = null!;
private _showNum = 0;
start() {
// [3]
}
......@@ -25,6 +27,11 @@ export class AdjacentArrayItemCtr extends Component {
setNum(value: number) {
this.numLab.string = value.toString();
this._showNum = value;
}
getNum(){
return this._showNum;
}
// update (deltaTime: number) {
......
......@@ -1081,4 +1081,32 @@ export const levelCfg: OneVarLevelItf[] = [
}
]
}
, {
gameIdHead: 170,
title: "邻接数组",
desc: "邻接数组,第一个版本",
levelArr: [{
gameId: 17001,
sceneUnitIfo: SCENE_DEF.AdjacentArray_1,
comName: "AdjacentArrayCtr",
level: 1,
resData: {
totalTime: 60,
level: 1,
isShowGuide: true
}
}
, {
gameId: 17002,
sceneUnitIfo: SCENE_DEF.AdjacentArray_1,
comName: "AdjacentArrayCtr",
level: 2,
resData: {
totalTime: 120,
level: 2
}
}
]
}
];
\ No newline at end of file
......@@ -26,7 +26,7 @@ export class LevelHomeCtr extends Component {
// [3]
if (!levelMgr.loadedOutData) {
levelMgr.loadedOutData = true;
levelMgr.gameIdHead = 10;
levelMgr.gameIdHead = 170;
levelMgr.unLockCount = 10;
if (Utils.getValueFromHref("gameIdHead")) {
levelMgr.gameIdHead = Number(Utils.getValueFromHref("gameIdHead"));
......
......@@ -101,6 +101,8 @@ interface ScenePathItf {
LatticeBlockade_1: ScenePathUnitItf,
//数字谜图
DigitalMysteryFigure_1: ScenePathUnitItf,
//邻接数组
AdjacentArray_1: ScenePathUnitItf,
}
export const SCENE_DEF: ScenePathItf = {
TestScene: {
......@@ -438,4 +440,9 @@ export const SCENE_DEF: ScenePathItf = {
sceneName: "DigitalMysteryFigure_1",
desc: "数字谜图,第一个版本"
},
AdjacentArray_1: {
bundleName: "sceneBundle",
sceneName: "AdjacentArray_1",
desc: "邻接数组,第一个版本"
},
}
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