[fix] Lobby 初始化清空 Child

This commit is contained in:
建喵 2022-05-07 10:54:33 +08:00
parent d771dd7593
commit 6bc14bc92a
11 changed files with 1278 additions and 1682 deletions

View File

@ -30,14 +30,14 @@
"_active": false, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 79 "__id__": 70
}, },
{ {
"__id__": 80 "__id__": 71
} }
], ],
"_prefab": { "_prefab": {
"__id__": 81 "__id__": 72
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
@ -276,7 +276,7 @@
"__uuid__": "1fd54956-5ef8-4cfb-b7c5-4b1ade8128e8" "__uuid__": "1fd54956-5ef8-4cfb-b7c5-4b1ade8128e8"
}, },
"_type": 0, "_type": 0,
"_sizeMode": 1, "_sizeMode": 0,
"_fillType": 0, "_fillType": 0,
"_fillCenter": { "_fillCenter": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
@ -312,13 +312,13 @@
"__id__": 9 "__id__": 9
}, },
{ {
"__id__": 47 "__id__": 50
} }
], ],
"_active": true, "_active": true,
"_components": [], "_components": [],
"_prefab": { "_prefab": {
"__id__": 78 "__id__": 69
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
@ -391,7 +391,7 @@
"_active": true, "_active": true,
"_components": [], "_components": [],
"_prefab": { "_prefab": {
"__id__": 46 "__id__": 49
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
@ -960,16 +960,16 @@
"__id__": 25 "__id__": 25
}, },
{ {
"__id__": 32 "__id__": 33
}, },
{ {
"__id__": 39 "__id__": 41
} }
], ],
"_active": true, "_active": true,
"_components": [], "_components": [],
"_prefab": { "_prefab": {
"__id__": 45 "__id__": 48
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
@ -1036,11 +1036,11 @@
"__id__": 29 "__id__": 29
}, },
{ {
"__id__": 30 "__id__": 31
} }
], ],
"_prefab": { "_prefab": {
"__id__": 31 "__id__": 32
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
@ -1208,7 +1208,11 @@
"_grayMaterial": null, "_grayMaterial": null,
"duration": 0.1, "duration": 0.1,
"zoomScale": 0.9, "zoomScale": 0.9,
"clickEvents": [], "clickEvents": [
{
"__id__": 30
}
],
"_N$interactable": true, "_N$interactable": true,
"_N$enableAutoGrayEffect": false, "_N$enableAutoGrayEffect": false,
"_N$transition": 1, "_N$transition": 1,
@ -1268,6 +1272,16 @@
}, },
"_id": "" "_id": ""
}, },
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 1
},
"component": "",
"_componentId": "424db5d3RpBGIWSlkuF1LkT",
"handler": "OnClickConfirm",
"customEventData": ""
},
{ {
"__type__": "cc.Sprite", "__type__": "cc.Sprite",
"_name": "", "_name": "",
@ -1320,20 +1334,20 @@
}, },
"_children": [ "_children": [
{ {
"__id__": 33 "__id__": 34
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 36 "__id__": 37
}, },
{ {
"__id__": 37 "__id__": 39
} }
], ],
"_prefab": { "_prefab": {
"__id__": 38 "__id__": 40
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
@ -1387,17 +1401,17 @@
"_name": "Image", "_name": "Image",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 32 "__id__": 33
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 34 "__id__": 35
} }
], ],
"_prefab": { "_prefab": {
"__id__": 35 "__id__": 36
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
@ -1451,7 +1465,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 33 "__id__": 34
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -1494,14 +1508,18 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 32 "__id__": 33
}, },
"_enabled": true, "_enabled": true,
"_normalMaterial": null, "_normalMaterial": null,
"_grayMaterial": null, "_grayMaterial": null,
"duration": 0.1, "duration": 0.1,
"zoomScale": 0.9, "zoomScale": 0.9,
"clickEvents": [], "clickEvents": [
{
"__id__": 38
}
],
"_N$interactable": true, "_N$interactable": true,
"_N$enableAutoGrayEffect": false, "_N$enableAutoGrayEffect": false,
"_N$transition": 1, "_N$transition": 1,
@ -1557,16 +1575,26 @@
"hoverSprite": null, "hoverSprite": null,
"_N$disabledSprite": null, "_N$disabledSprite": null,
"_N$target": { "_N$target": {
"__id__": 32 "__id__": 33
}, },
"_id": "" "_id": ""
}, },
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 1
},
"component": "",
"_componentId": "424db5d3RpBGIWSlkuF1LkT",
"handler": "Close",
"customEventData": ""
},
{ {
"__type__": "cc.Sprite", "__type__": "cc.Sprite",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 32 "__id__": 33
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -1613,17 +1641,17 @@
}, },
"_children": [ "_children": [
{ {
"__id__": 40 "__id__": 42
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 43 "__id__": 45
} }
], ],
"_prefab": { "_prefab": {
"__id__": 44 "__id__": 47
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
@ -1677,17 +1705,17 @@
"_name": "Image", "_name": "Image",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 39 "__id__": 41
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 41 "__id__": 43
} }
], ],
"_prefab": { "_prefab": {
"__id__": 42 "__id__": 44
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
@ -1741,7 +1769,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 40 "__id__": 42
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -1784,14 +1812,18 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 39 "__id__": 41
}, },
"_enabled": true, "_enabled": true,
"_normalMaterial": null, "_normalMaterial": null,
"_grayMaterial": null, "_grayMaterial": null,
"duration": 0.1, "duration": 0.1,
"zoomScale": 0.9, "zoomScale": 0.9,
"clickEvents": [], "clickEvents": [
{
"__id__": 46
}
],
"_N$interactable": true, "_N$interactable": true,
"_N$enableAutoGrayEffect": false, "_N$enableAutoGrayEffect": false,
"_N$transition": 1, "_N$transition": 1,
@ -1847,10 +1879,20 @@
"hoverSprite": null, "hoverSprite": null,
"_N$disabledSprite": null, "_N$disabledSprite": null,
"_N$target": { "_N$target": {
"__id__": 39 "__id__": 41
}, },
"_id": "" "_id": ""
}, },
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 1
},
"component": "",
"_componentId": "424db5d3RpBGIWSlkuF1LkT",
"handler": "OnClickNextColor",
"customEventData": ""
},
{ {
"__type__": "cc.PrefabInfo", "__type__": "cc.PrefabInfo",
"root": { "root": {
@ -1893,13 +1935,13 @@
}, },
"_children": [ "_children": [
{ {
"__id__": 48 "__id__": 51
} }
], ],
"_active": true, "_active": true,
"_components": [], "_components": [],
"_prefab": { "_prefab": {
"__id__": 77 "__id__": 68
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
@ -1953,24 +1995,24 @@
"_name": "Scroll View", "_name": "Scroll View",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 47 "__id__": 50
}, },
"_children": [ "_children": [
{ {
"__id__": 49 "__id__": 52
}, },
{ {
"__id__": 56 "__id__": 59
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 54 "__id__": 57
} }
], ],
"_prefab": { "_prefab": {
"__id__": 76 "__id__": 67
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
@ -2024,27 +2066,27 @@
"_name": "scrollBar", "_name": "scrollBar",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 48 "__id__": 51
}, },
"_children": [ "_children": [
{ {
"__id__": 50 "__id__": 53
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 53 "__id__": 56
}, },
{ {
"__id__": 73 "__id__": 64
}, },
{ {
"__id__": 74 "__id__": 65
} }
], ],
"_prefab": { "_prefab": {
"__id__": 75 "__id__": 66
}, },
"_opacity": 0, "_opacity": 0,
"_color": { "_color": {
@ -2098,17 +2140,17 @@
"_name": "bar", "_name": "bar",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 49 "__id__": 52
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 51 "__id__": 54
} }
], ],
"_prefab": { "_prefab": {
"__id__": 52 "__id__": 55
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
@ -2162,7 +2204,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 50 "__id__": 53
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -2205,18 +2247,18 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 49 "__id__": 52
}, },
"_enabled": true, "_enabled": true,
"_scrollView": { "_scrollView": {
"__id__": 54 "__id__": 57
}, },
"_touching": false, "_touching": false,
"_opacity": 255, "_opacity": 255,
"enableAutoHide": true, "enableAutoHide": true,
"autoHideTime": 1, "autoHideTime": 1,
"_N$handle": { "_N$handle": {
"__id__": 51 "__id__": 54
}, },
"_N$direction": 1, "_N$direction": 1,
"_id": "" "_id": ""
@ -2226,7 +2268,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 48 "__id__": 51
}, },
"_enabled": true, "_enabled": true,
"horizontal": false, "horizontal": false,
@ -2238,14 +2280,14 @@
"scrollEvents": [], "scrollEvents": [],
"cancelInnerEvents": true, "cancelInnerEvents": true,
"_N$content": { "_N$content": {
"__id__": 55 "__id__": 58
}, },
"content": { "content": {
"__id__": 55 "__id__": 58
}, },
"_N$horizontalScrollBar": null, "_N$horizontalScrollBar": null,
"_N$verticalScrollBar": { "_N$verticalScrollBar": {
"__id__": 53 "__id__": 56
}, },
"_id": "" "_id": ""
}, },
@ -2254,21 +2296,17 @@
"_name": "Content", "_name": "Content",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 56 "__id__": 59
}, },
"_children": [ "_children": [],
{
"__id__": 59
}
],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 71 "__id__": 62
} }
], ],
"_prefab": { "_prefab": {
"__id__": 72 "__id__": 63
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
@ -2322,21 +2360,21 @@
"_name": "view", "_name": "view",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 48 "__id__": 51
}, },
"_children": [ "_children": [
{ {
"__id__": 55 "__id__": 58
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 57 "__id__": 60
} }
], ],
"_prefab": { "_prefab": {
"__id__": 58 "__id__": 61
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
@ -2390,7 +2428,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 56 "__id__": 59
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -2416,439 +2454,12 @@
"fileId": "96UE0srKRJJZj7RvxQ+wdJ", "fileId": "96UE0srKRJJZj7RvxQ+wdJ",
"sync": false "sync": false
}, },
{
"__type__": "cc.Node",
"_name": "Item",
"_objFlags": 0,
"_parent": {
"__id__": 55
},
"_children": [
{
"__id__": 60
},
{
"__id__": 66
}
],
"_active": true,
"_components": [
{
"__id__": 69
}
],
"_prefab": {
"__id__": 70
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 115,
"height": 215
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 596.95
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
128129.25000000001,
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": "Avatar",
"_objFlags": 0,
"_parent": {
"__id__": 59
},
"_children": [
{
"__id__": 61
}
],
"_active": true,
"_components": [
{
"__id__": 64
}
],
"_prefab": {
"__id__": 65
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 115,
"height": 209
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-0.445,
-128233.75000000001,
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": "Pic",
"_objFlags": 512,
"_parent": {
"__id__": 60
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 62
}
],
"_prefab": {
"__id__": 63
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 170,
"height": 235
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-3.917,
7.4,
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__": 61
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "591e9fe0-34ff-4ca9-936d-6224c67887ce"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 59
},
"asset": {
"__uuid__": "69e392a1-9f30-4448-9cd0-b8f9af9df603"
},
"fileId": "708AlFdEBEV55OC+i1Itot",
"sync": false
},
{
"__type__": "cc.Mask",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 60
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_spriteFrame": null,
"_type": 0,
"_segments": 64,
"_N$alphaThreshold": 0.1,
"_N$inverted": false,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 59
},
"asset": {
"__uuid__": "69e392a1-9f30-4448-9cd0-b8f9af9df603"
},
"fileId": "66DqVtV79NDouyrlS2pF9l",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "Border",
"_objFlags": 0,
"_parent": {
"__id__": 59
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 67
}
],
"_prefab": {
"__id__": 68
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 115,
"height": 6
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-0.041,
-128341.25000000001,
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__": 66
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 59
},
"asset": {
"__uuid__": "69e392a1-9f30-4448-9cd0-b8f9af9df603"
},
"fileId": "242Y7/XJpPhZ6c8dSw9g82",
"sync": false
},
{ {
"__type__": "cc.Layout", "__type__": "cc.Layout",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 59 "__id__": 58
},
"_enabled": true,
"_layoutSize": {
"__type__": "cc.Size",
"width": 115,
"height": 215
},
"_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": 0,
"_N$verticalDirection": 1,
"_N$horizontalDirection": 0,
"_N$affectedByScale": false,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 59
},
"asset": {
"__uuid__": "69e392a1-9f30-4448-9cd0-b8f9af9df603"
},
"fileId": "29QGakioxOjJiC3ETKXehF",
"sync": false
},
{
"__type__": "cc.Layout",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 55
}, },
"_enabled": true, "_enabled": true,
"_layoutSize": { "_layoutSize": {
@ -2891,7 +2502,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 49 "__id__": 52
}, },
"_enabled": true, "_enabled": true,
"alignMode": 0, "alignMode": 0,
@ -2918,7 +2529,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 49 "__id__": 52
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -3017,6 +2628,18 @@
"__id__": 1 "__id__": 1
}, },
"_enabled": true, "_enabled": true,
"BtnItem": {
"__uuid__": "69e392a1-9f30-4448-9cd0-b8f9af9df603"
},
"ItemContent": {
"__id__": 58
},
"InfoView": {
"__id__": 9
},
"BG": {
"__id__": 6
},
"_id": "" "_id": ""
}, },
{ {

View File

@ -21,17 +21,17 @@
"__id__": 2 "__id__": 2
}, },
{ {
"__id__": 8 "__id__": 5
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 11 "__id__": 15
} }
], ],
"_prefab": { "_prefab": {
"__id__": 12 "__id__": 16
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
@ -80,6 +80,113 @@
"groupIndex": 0, "groupIndex": 0,
"_id": "" "_id": ""
}, },
{
"__type__": "cc.Node",
"_name": "Border",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 3
}
],
"_prefab": {
"__id__": 4
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 115,
"height": 6
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-0.041,
-128132.25000000001,
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__": "a23235d1-15db-4b95-8439-a2e005bfff91"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "69e392a1-9f30-4448-9cd0-b8f9af9df603"
},
"fileId": "242Y7/XJpPhZ6c8dSw9g82",
"sync": false
},
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "Avatar", "_name": "Avatar",
@ -89,17 +196,23 @@
}, },
"_children": [ "_children": [
{ {
"__id__": 3 "__id__": 6
},
{
"__id__": 9
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 6 "__id__": 12
},
{
"__id__": 13
} }
], ],
"_prefab": { "_prefab": {
"__id__": 7 "__id__": 14
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
@ -124,7 +237,7 @@
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
-0.445, -0.445,
-128233.75000000001, -128239.75000000001,
0, 0,
0, 0,
0, 0,
@ -150,20 +263,20 @@
}, },
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "Pic", "_name": "BG",
"_objFlags": 512, "_objFlags": 512,
"_parent": { "_parent": {
"__id__": 2 "__id__": 5
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 4 "__id__": 7
} }
], ],
"_prefab": { "_prefab": {
"__id__": 5 "__id__": 8
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
@ -217,7 +330,112 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 3 "__id__": 6
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": null,
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "69e392a1-9f30-4448-9cd0-b8f9af9df603"
},
"fileId": "28/DkOIjFCM7cZQscnEIYj",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "Pic",
"_objFlags": 512,
"_parent": {
"__id__": 5
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 10
}
],
"_prefab": {
"__id__": 11
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 170,
"height": 235
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-3.917,
7.4,
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__": 9
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -260,7 +478,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 2 "__id__": 5
}, },
"_enabled": true, "_enabled": true,
"_materials": [ "_materials": [
@ -275,6 +493,76 @@
"_N$inverted": false, "_N$inverted": false,
"_id": "" "_id": ""
}, },
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 5
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 1,
"transition": 1,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"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": 245,
"g": 245,
"b": 245,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 245,
"g": 245,
"b": 245,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 6
},
"_id": ""
},
{ {
"__type__": "cc.PrefabInfo", "__type__": "cc.PrefabInfo",
"root": { "root": {
@ -286,113 +574,6 @@
"fileId": "66DqVtV79NDouyrlS2pF9l", "fileId": "66DqVtV79NDouyrlS2pF9l",
"sync": false "sync": false
}, },
{
"__type__": "cc.Node",
"_name": "Border",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 9
}
],
"_prefab": {
"__id__": 10
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 115,
"height": 6
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-0.041,
-128341.25000000001,
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__": 8
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "69e392a1-9f30-4448-9cd0-b8f9af9df603"
},
"fileId": "242Y7/XJpPhZ6c8dSw9g82",
"sync": false
},
{ {
"__type__": "cc.Layout", "__type__": "cc.Layout",
"_name": "", "_name": "",

View File

@ -213,7 +213,7 @@
"__id__": 1 "__id__": 1
}, },
"_children": [], "_children": [],
"_active": true, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 6 "__id__": 6
@ -861,14 +861,14 @@
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
"x": 0.5, "x": 0,
"y": 0.5 "y": 0.5
}, },
"_trs": { "_trs": {
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
-83.331, -115,
0, 0,
0, 0,
0, 0,

File diff suppressed because it is too large Load Diff

View File

@ -1,12 +1,148 @@
import { Badminton } from "../Badminton/Badminton";
import { AvatarColor, AvatarData, MemberData } from "../Badminton/MemberData";
import UIPanel from "../Engine/Component/UIPanel/UIPanel"; import UIPanel from "../Engine/Component/UIPanel/UIPanel";
import { RandomEx } from "../Engine/Utils/Number/RandomEx";
const { ccclass, property } = cc._decorator; const { ccclass, property } = cc._decorator;
/** AvatarPanel */ /** AvatarPanel */
@ccclass @ccclass
export default class AvatarPanel extends UIPanel { export default class AvatarPanel extends UIPanel {
//#region property
//#region OnClick @property({ type: cc.Prefab })
public BtnItem: cc.Prefab = null;
@property({ type: cc.Node })
public ItemContent: cc.Node = null;
@property({ type: cc.Node })
public InfoView: cc.Node = null;
@property({ type: cc.Sprite })
public BG: cc.Sprite = null;
//#endregion
//#region public
public Main: Badminton = null;
//#endregion
//#region private
private _m_currentMember: MemberData = null;
private _avatars: AvatarData[] = null;
private _m_currentIndex: number = null;
//#endregion
//#region Lifecycle
protected ImplementInitial(...initData: any[]): void {
let self: this = this;
this.Main = initData[0];
this._avatars = this.Main.config.Avatars;
let btnItem: cc.Node = cc.instantiate(this.BtnItem);
btnItem.active = false;
// 載入兔兔設定 更新UI
let container: cc.Node = this.ItemContent;
for (let i: number = container.childrenCount - 1; i >= 0; i--) {
let obj: cc.Node = container.children[i];
if (obj !== btnItem) {
obj.destroy();
}
}
for (let i: number = 0; i < this._avatars.length; i++) {
let data: AvatarData = this._avatars[i];
if (data.color !== AvatarColor.Pink && data.color !== AvatarColor.None) {
continue;
}
let item: cc.Node = container.ExAddChild(btnItem);
item.Find("Avatar/Pic").getComponent(cc.Sprite).spriteFrame = data.Pic;
item.Find("Avatar/BG").getComponent(cc.Sprite).spriteFrame = data.BG;
item.Find("Avatar").on("click", () => { self._showAvatarInfoById(i); });
item.active = true;
}
}
protected *ImplementReadyShow(...param: any[]): IterableIterator<any> {
this._m_currentMember = param[0];
}
protected *ImplementShow(): IterableIterator<any> {
if (this._m_currentMember != null) {
let index: number = 0;
for (let i: number = 0; i < this._avatars.length; i++) {
if (this._m_currentMember.AvatarId === this._avatars[i].ID) {
index = i;
break;
}
}
this._showAvatarInfoById(index);
}
this.Main.Lobby.Close();
}
protected *ImplementHide(...param: any[]): IterableIterator<any> {
yield* this.Main.Lobby.Show();
}
//#endregion
//#region Custom
private _getNextColorAvatarIndex(index: number): number {
if (index < 0 || index >= this._avatars.length) {
return 0;
}
let cur: AvatarData = this._avatars[index];
for (let i: number = 0; i < this._avatars.length; i++) {
let data: AvatarData = this._avatars[i];
if (data.Model === cur.Model && data.color !== cur.color) {
return i;
}
}
return 0;
}
private _showAvatarInfoById(index: number): void {
if (index < 0 || index >= this._avatars.length) {
return;
}
let data: AvatarData = this._avatars[index];
this.BG.spriteFrame = data.BG;
this.InfoView.Find("Image").getComponent(cc.Sprite).spriteFrame = data.BigPic != null ? data.BigPic : data.Pic;
this.InfoView.Find("Title/Text").getComponent(cc.Label).string = data.Name;
this.InfoView.Find("Text").getComponent(cc.Label).string = data.Desc;
this._m_currentIndex = index;
}
public OnClickNextColor(): void {
this._showAvatarInfoById(this._getNextColorAvatarIndex(this._m_currentIndex));
}
public OnClickConfirm(): void {
let data: AvatarData = this._avatars[this._m_currentIndex];
if (data.Model <= 0) {
// let list = this._avatars.FindAll(a => a.model > 0);
// let list: any[] = this._avatars.map(a => {
// if (a.Model > 0) {
// return Object.values(a)[0];
// }
// }).filter(item => item);
let list: AvatarData[] = this._avatars.filter(item => item.Model > 0);
data = list[RandomEx.GetInt(0, list.length)];
}
this._m_currentMember.AvatarId = data.ID;
this.Main.ReloadUI();
this.Close();
}
//#endregion //#endregion
} }

View File

@ -131,6 +131,7 @@ export class Badminton extends cc.Component {
CoroutineV2.Single(self.HistoryPanel.Hide()).Start(); CoroutineV2.Single(self.HistoryPanel.Hide()).Start();
} }
// textToSpeech = FindObjectOfType<TextToSpeech>(); // textToSpeech = FindObjectOfType<TextToSpeech>();
self.AvatarPanel.Initial(self);
CoroutineV2.Single(self.Show()).Start(); CoroutineV2.Single(self.Show()).Start();
}; };
CoroutineV2.Single(AsyncFunction()).Start(); CoroutineV2.Single(AsyncFunction()).Start();
@ -158,17 +159,19 @@ export class Badminton extends cc.Component {
this._updateCurSelMember(); this._updateCurSelMember();
// this.toggleItem.gameObject.SetActive(false); // this.toggleItem.gameObject.SetActive(false);
// this.teamItem.gameObject.SetActive(false); // this.teamItem.gameObject.SetActive(false);
let parent: cc.Node = this.TeamItemContent; let parent: cc.Node = this.TeamItemContent;
for (let i: number = parent.childrenCount - 1; i > 0; i--) { // for (let i: number = parent.childrenCount - 1; i > 0; i--) {
parent.children[i].destroy(); // parent.children[i].destroy();
} // }
parent.removeAllChildren();
this._m_teamList.Clear(); this._m_teamList.Clear();
parent = this.ToggleItemContent; parent = this.ToggleItemContent;
for (let i: number = parent.childrenCount - 1; i > 0; i--) { // for (let i: number = parent.childrenCount - 1; i > 0; i--) {
parent.children[i].destroy(); // parent.children[i].destroy();
} // }
parent.removeAllChildren();
this._m_toggleList.Clear(); this._m_toggleList.Clear();
for (let idx: number = 0; idx < this.TeamMemberList.length; idx++) { for (let idx: number = 0; idx < this.TeamMemberList.length; idx++) {
@ -180,7 +183,7 @@ export class Badminton extends cc.Component {
let picObj: cc.Node = item.node.getChildByName("Avatar").getChildByName("Pic"); let picObj: cc.Node = item.node.getChildByName("Avatar").getChildByName("Pic");
if (picObj != null) { if (picObj != null) {
picObj.getComponent(cc.Sprite).spriteFrame = this.config.GetAvatarPicById(this.TeamMemberList[idx].AvatarId); picObj.getComponent(cc.Sprite).spriteFrame = this.config.GetAvatarPicById(this.TeamMemberList[idx].AvatarId);
picObj.parent.getComponent(HoldButton).OnInvoke.AddListener(() => { this.OnChangeAvatar(idx); }); picObj.parent.getComponent(HoldButton).OnInvoke.AddListener(() => { this.OnChangeAvatar(+idx); });
picObj.parent.on("click", () => { picObj.parent.on("click", () => {
item.isChecked = !item.isChecked; item.isChecked = !item.isChecked;
self._onChangeSelMember(item); self._onChangeSelMember(item);
@ -347,9 +350,7 @@ export class Badminton extends cc.Component {
} }
public OnChangeAvatar(index: number): void { public OnChangeAvatar(index: number): void {
index = +index; CoroutineV2.Single(this.AvatarPanel.Show(this.TeamMemberList[index])).Start();
console.log("OnChangeAvatar");
// this.AvatarPanel.OpenChange(teamMemberList[index]);
} }
public LoadStatus(): void { public LoadStatus(): void {

View File

@ -8,22 +8,18 @@ import { AvatarData, MemberData } from "./MemberData";
/** ConfigManager */ /** ConfigManager */
export default class ConfigManager { export default class ConfigManager {
//#region get //#region public
public Main: Badminton = null; public Main: Badminton = null;
//#endregion
//#region public
public Avatars: AvatarData[] = []; public Avatars: AvatarData[] = [];
//#endregion //#endregion
//#region Lifecycle //#region Lifecycle
constructor(mainControl: Badminton) { constructor(main: Badminton) {
this.Main = mainControl; this.Main = main;
} }
public *Init(): IterableIterator<any> { public *Init(): IterableIterator<any> {

View File

@ -1,3 +1,4 @@
const { ccclass, property } = cc._decorator; const { ccclass, property } = cc._decorator;
//#region Enum //#region Enum
@ -25,8 +26,9 @@ export class MemberData {
/** /**
* @param {string} name * @param {string} name
*/ */
constructor(name: string) { constructor(name: string, avatarId: number = 0) {
this.Name = name; this.Name = name;
this.AvatarId = avatarId;
} }
} }

View File

@ -91,10 +91,12 @@ export default class HoldButton extends cc.Component {
this._m_pressDeltaTime = 0; this._m_pressDeltaTime = 0;
if (this.OnInvoke != null) { if (this.OnInvoke != null) {
this.OnInvoke.forEach((eventHandler: cc.Component.EventHandler) => { this.OnInvoke.forEach((eventHandler: cc.Component.EventHandler) => {
if (eventHandler.target === <any>"Callback" && eventHandler.component === "Callback" && eventHandler.handler) { if (eventHandler) {
(<Function><unknown>eventHandler.handler)(); if (eventHandler.target === <any>"Callback" && eventHandler.component === "Callback" && eventHandler.handler) {
} else { (<Function><unknown>eventHandler.handler)();
eventHandler.emit([this.node.getComponent(cc.Button)]); } else {
eventHandler.emit([this.node.getComponent(cc.Button)]);
}
} }
}); });
} }

View File

@ -39,6 +39,13 @@ declare namespace cc {
/**位置維持在原位 */ /**位置維持在原位 */
ExSetParent(parentObj: cc.Node): void; ExSetParent(parentObj: cc.Node): void;
ExSetGray(showGray: boolean): void; ExSetGray(showGray: boolean): void;
/**
*
* @param name A name to find the child node.
* @example
* let child: cc.Node = this.node.Find("childname/childname");
*/
Find(name: string): cc.Node;
} }
} }
@ -184,6 +191,27 @@ cc.Node.prototype.ExSetGray || Object.defineProperty(cc.Node.prototype, 'ExSetGr
// } // }
}, },
}); });
cc.Node.prototype.Find || Object.defineProperty(cc.Node.prototype, "Find", {
enumerable: false,
/**
*
* @param name A name to find the child node.
*/
value: function (name: string): any {
let names: string[] = name.split("/");
let node: cc.Node = this;
for (let i: number = 0; i < names.length; i++) {
const targetname: string = names[i];
let nodeName: string = node.name;
node = node.getChildByName(targetname);
if (!node) {
cc.error(`${nodeName} child hst not found ${targetname} in node`);
return null;
}
}
return node;
},
});
// cc.Node.prototype.SetWorldPosition = function (cocosWorldPos: cc.Vec2): void { // cc.Node.prototype.SetWorldPosition = function (cocosWorldPos: cc.Vec2): void {
// // let cocosWorldPos = new cc.Vec2(unityWorldPos.x + 711, unityWorldPos.y + 400); // // let cocosWorldPos = new cc.Vec2(unityWorldPos.x + 711, unityWorldPos.y + 400);
// this.setPosition(this.parent.convertToNodeSpaceAR(cocosWorldPos)); // this.setPosition(this.parent.convertToNodeSpaceAR(cocosWorldPos));

View File

@ -6,7 +6,11 @@ const { ccclass, property } = cc._decorator;
@ccclass @ccclass
export default class Lobby extends UIPanel { export default class Lobby extends UIPanel {
//#region OnClick //#region Lifecycle
protected *ImplementReadyShow(...param: any[]): IterableIterator<any> {
cc.log("Lobby ImplementReadyShow");
}
//#endregion //#endregion
} }