Modal windows

This commit is contained in:
Martin 2022-12-21 14:08:49 +01:00
parent b4abb4df21
commit f3eb520300
25 changed files with 5287 additions and 263 deletions

View File

@ -0,0 +1,12 @@
{
"ver": "1.1.0",
"importer": "directory",
"imported": true,
"uuid": "6eecde6d-8549-4f5f-9102-56e97f0156d3",
"files": [],
"subMetas": {},
"userData": {
"compressionType": {},
"isRemoteBundle": {}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,13 @@
{
"ver": "1.1.40",
"importer": "prefab",
"imported": true,
"uuid": "9f66fba0-82b2-481c-835d-41cb87f38d87",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "AudioSettingsModalWindow"
}
}

View File

@ -0,0 +1,12 @@
{
"ver": "1.1.0",
"importer": "directory",
"imported": true,
"uuid": "a899e711-65d5-4530-ab7d-ed2f77f485fa",
"files": [],
"subMetas": {},
"userData": {
"compressionType": {},
"isRemoteBundle": {}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,13 @@
{
"ver": "1.1.40",
"importer": "prefab",
"imported": true,
"uuid": "cc259578-1eb4-4dd3-87b0-fd42c11668b1",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "PauseModalWindow"
}
}

View File

@ -27,11 +27,11 @@
"_active": true, "_active": true,
"_components": [], "_components": [],
"_prefab": { "_prefab": {
"__id__": 106 "__id__": 103
}, },
"autoReleaseAssets": false, "autoReleaseAssets": false,
"_globals": { "_globals": {
"__id__": 109 "__id__": 106
}, },
"_id": "cffa5b19-2043-4cef-8221-1a10ab7a2c1f" "_id": "cffa5b19-2043-4cef-8221-1a10ab7a2c1f"
}, },
@ -246,17 +246,17 @@
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{
"__id__": 99
},
{
"__id__": 100
},
{
"__id__": 101
},
{ {
"__id__": 102 "__id__": 102
},
{
"__id__": 103
},
{
"__id__": 104
},
{
"__id__": 105
} }
], ],
"_prefab": null, "_prefab": null,
@ -1242,7 +1242,10 @@
"__id__": 49 "__id__": 49
}, },
{ {
"__id__": 75 "__id__": 83
},
{
"__id__": 86
}, },
{ {
"__id__": 89 "__id__": 89
@ -1252,15 +1255,12 @@
}, },
{ {
"__id__": 95 "__id__": 95
},
{
"__id__": 98
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 101 "__id__": 98
} }
], ],
"_prefab": null, "_prefab": null,
@ -1304,13 +1304,13 @@
"__id__": 50 "__id__": 50
}, },
{ {
"__id__": 65 "__id__": 73
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 74 "__id__": 82
} }
], ],
"_prefab": null, "_prefab": null,
@ -1355,15 +1355,18 @@
}, },
{ {
"__id__": 60 "__id__": 60
},
{
"__id__": 63
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 63 "__id__": 71
}, },
{ {
"__id__": 64 "__id__": 72
} }
], ],
"_prefab": null, "_prefab": null,
@ -1805,6 +1808,303 @@
"_cacheMode": 1, "_cacheMode": 1,
"_id": "b8o2CHyMhO9KAlJh/3XhyY" "_id": "b8o2CHyMhO9KAlJh/3XhyY"
}, },
{
"__type__": "cc.Node",
"_name": "PauseBtn",
"_objFlags": 0,
"_parent": {
"__id__": 50
},
"_children": [
{
"__id__": 64
}
],
"_active": true,
"_components": [
{
"__id__": 67
},
{
"__id__": 68
},
{
"__id__": 69
},
{
"__id__": 70
}
],
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": 603.924,
"y": -76.711,
"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": "7a8ey4eQ5ACb/mhdDxPxpd"
},
{
"__type__": "cc.Node",
"_name": "Square",
"_objFlags": 0,
"_parent": {
"__id__": 63
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 65
},
{
"__id__": 66
}
],
"_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": "dcRN37ItxLboPDLPWwzjKO"
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 64
},
"_enabled": true,
"__prefab": null,
"_contentSize": {
"__type__": "cc.Size",
"width": 12.86,
"height": 40
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": "adDG8y+fZOfrN9jWGjR0cP"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 64
},
"_enabled": true,
"__prefab": null,
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_string": "||",
"_horizontalAlign": 1,
"_verticalAlign": 1,
"_actualFontSize": 40,
"_fontSize": 40,
"_fontFamily": "Arial",
"_lineHeight": 40,
"_overflow": 0,
"_enableWrapText": true,
"_font": {
"__uuid__": "c96b42a9-d20d-4c59-8e99-8ed749a715c8",
"__expectedType__": "cc.BitmapFont"
},
"_isSystemFontUsed": false,
"_spacingX": 0,
"_isItalic": false,
"_isBold": false,
"_isUnderline": false,
"_underlineHeight": 2,
"_cacheMode": 0,
"_id": "9dk/u2oGtHEpcYGIirpl0Q"
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 63
},
"_enabled": true,
"__prefab": null,
"_contentSize": {
"__type__": "cc.Size",
"width": 40,
"height": 40
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": "62wi6kavtBtpyGjoKS4DCy"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 63
},
"_enabled": true,
"__prefab": null,
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 1,
"_fillType": 0,
"_sizeMode": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": "70UulEaghB2K8A/5EW917H"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 63
},
"_enabled": true,
"__prefab": null,
"clickEvents": [],
"_interactable": true,
"_transition": 2,
"_normalColor": {
"__type__": "cc.Color",
"r": 214,
"g": 214,
"b": 214,
"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": {
"__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_hoverSprite": {
"__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_pressedSprite": {
"__uuid__": "544e49d6-3f05-4fa8-9a9e-091f98fc2ce8@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_disabledSprite": {
"__uuid__": "951249e0-9f16-456d-8b85-a6ca954da16b@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_duration": 0.1,
"_zoomScale": 1.2,
"_target": {
"__id__": 63
},
"_id": "44V8O8mzZKQZv5NNhU9U2X"
},
{
"__type__": "55e5f5nQ8dHiL5fPWjgdXbH",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 63
},
"_enabled": true,
"__prefab": null,
"_id": "94Ye77Hc9Hw6DUaP7suX3j"
},
{ {
"__type__": "cc.UITransform", "__type__": "cc.UITransform",
"_name": "", "_name": "",
@ -1864,13 +2164,13 @@
}, },
"_children": [ "_children": [
{ {
"__id__": 66 "__id__": 74
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 73 "__id__": 81
} }
], ],
"_prefab": null, "_prefab": null,
@ -1907,23 +2207,23 @@
"_name": "VirtualJoystic", "_name": "VirtualJoystic",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 65 "__id__": 73
}, },
"_children": [ "_children": [
{ {
"__id__": 67 "__id__": 75
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 70 "__id__": 78
}, },
{ {
"__id__": 71 "__id__": 79
}, },
{ {
"__id__": 72 "__id__": 80
} }
], ],
"_prefab": null, "_prefab": null,
@ -1960,16 +2260,16 @@
"_name": "Knob", "_name": "Knob",
"_objFlags": 0, "_objFlags": 0,
"_parent": { "_parent": {
"__id__": 66 "__id__": 74
}, },
"_children": [], "_children": [],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 68 "__id__": 76
}, },
{ {
"__id__": 69 "__id__": 77
} }
], ],
"_prefab": null, "_prefab": null,
@ -2006,7 +2306,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 67 "__id__": 75
}, },
"_enabled": true, "_enabled": true,
"__prefab": null, "__prefab": null,
@ -2027,7 +2327,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 67 "__id__": 75
}, },
"_enabled": true, "_enabled": true,
"__prefab": null, "__prefab": null,
@ -2065,7 +2365,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 66 "__id__": 74
}, },
"_enabled": true, "_enabled": true,
"__prefab": null, "__prefab": null,
@ -2086,7 +2386,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 66 "__id__": 74
}, },
"_enabled": true, "_enabled": true,
"__prefab": null, "__prefab": null,
@ -2124,13 +2424,13 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 66 "__id__": 74
}, },
"_enabled": true, "_enabled": true,
"__prefab": null, "__prefab": null,
"maxDistance": 50, "maxDistance": 50,
"knob": { "knob": {
"__id__": 67 "__id__": 75
}, },
"_id": "50ceZG62tGlYXvZWEvSDKl" "_id": "50ceZG62tGlYXvZWEvSDKl"
}, },
@ -2139,7 +2439,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 65 "__id__": 73
}, },
"_enabled": true, "_enabled": true,
"__prefab": null, "__prefab": null,
@ -2170,6 +2470,9 @@
"timeAliveText": { "timeAliveText": {
"__id__": 62 "__id__": 62
}, },
"pauseBtn": {
"__id__": 70
},
"_id": "bau/7eItRFrKKoAZZb/uYL" "_id": "bau/7eItRFrKKoAZZb/uYL"
}, },
{ {
@ -2179,18 +2482,14 @@
"_parent": { "_parent": {
"__id__": 48 "__id__": 48
}, },
"_children": [ "_children": [],
{
"__id__": 76
}
],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 87 "__id__": 84
}, },
{ {
"__id__": 88 "__id__": 85
} }
], ],
"_prefab": null, "_prefab": null,
@ -2222,157 +2521,12 @@
}, },
"_id": "ddppxPynFF26nHKQloDmA6" "_id": "ddppxPynFF26nHKQloDmA6"
}, },
{
"__type__": "cc.Node",
"_objFlags": 0,
"_parent": {
"__id__": 75
},
"_prefab": {
"__id__": 77
},
"__editorExtras__": {}
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 76
},
"asset": {
"__uuid__": "663674aa-da1c-44b0-8049-49db9b020973",
"__expectedType__": "cc.Prefab"
},
"fileId": "32U/bJCUBDlaQxxGFNXZTu",
"instance": {
"__id__": 78
},
"targetOverrides": [
{
"__id__": 85
}
]
},
{
"__type__": "cc.PrefabInstance",
"fileId": "b6HDOu/ERCXLDdBfuOzUZW",
"mountedChildren": [],
"mountedComponents": [],
"propertyOverrides": [
{
"__id__": 79
},
{
"__id__": 81
},
{
"__id__": 82
},
{
"__id__": 83
},
{
"__id__": 84
}
],
"removedComponents": []
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 80
},
"propertyPath": [
"_name"
],
"value": "LevelUpModalWindow"
},
{
"__type__": "cc.TargetInfo",
"localID": [
"32U/bJCUBDlaQxxGFNXZTu"
]
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 80
},
"propertyPath": [
"_lpos"
],
"value": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
}
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 80
},
"propertyPath": [
"_lrot"
],
"value": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
}
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 80
},
"propertyPath": [
"_euler"
],
"value": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
}
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 80
},
"propertyPath": [
"_active"
],
"value": false
},
{
"__type__": "cc.TargetOverrideInfo",
"source": null,
"sourceInfo": null,
"propertyPath": [
"skills",
"2"
],
"target": null,
"targetInfo": {
"__id__": 86
}
},
{
"__type__": "cc.TargetInfo",
"localID": [
"8fXLBTR/JKgZXZPA29Dci3"
]
},
{ {
"__type__": "cc.UITransform", "__type__": "cc.UITransform",
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 75 "__id__": 83
}, },
"_enabled": true, "_enabled": true,
"__prefab": null, "__prefab": null,
@ -2393,7 +2547,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 75 "__id__": 83
}, },
"_enabled": true, "_enabled": true,
"__prefab": null, "__prefab": null,
@ -2401,6 +2555,14 @@
{ {
"__uuid__": "663674aa-da1c-44b0-8049-49db9b020973", "__uuid__": "663674aa-da1c-44b0-8049-49db9b020973",
"__expectedType__": "cc.Prefab" "__expectedType__": "cc.Prefab"
},
{
"__uuid__": "9f66fba0-82b2-481c-835d-41cb87f38d87",
"__expectedType__": "cc.Prefab"
},
{
"__uuid__": "cc259578-1eb4-4dd3-87b0-fd42c11668b1",
"__expectedType__": "cc.Prefab"
} }
], ],
"_id": "1afHrrV8tIPrYb4xymz6bQ" "_id": "1afHrrV8tIPrYb4xymz6bQ"
@ -2416,10 +2578,10 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 90 "__id__": 87
}, },
{ {
"__id__": 91 "__id__": 88
} }
], ],
"_prefab": null, "_prefab": null,
@ -2456,7 +2618,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 89 "__id__": 86
}, },
"_enabled": true, "_enabled": true,
"__prefab": null, "__prefab": null,
@ -2477,7 +2639,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 89 "__id__": 86
}, },
"_enabled": true, "_enabled": true,
"__prefab": null, "__prefab": null,
@ -2521,10 +2683,10 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 93 "__id__": 90
}, },
{ {
"__id__": 94 "__id__": 91
} }
], ],
"_prefab": null, "_prefab": null,
@ -2561,7 +2723,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 92 "__id__": 89
}, },
"_enabled": true, "_enabled": true,
"__prefab": null, "__prefab": null,
@ -2582,7 +2744,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 92 "__id__": 89
}, },
"_enabled": true, "_enabled": true,
"__prefab": null, "__prefab": null,
@ -2626,10 +2788,10 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 96 "__id__": 93
}, },
{ {
"__id__": 97 "__id__": 94
} }
], ],
"_prefab": null, "_prefab": null,
@ -2666,7 +2828,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 95 "__id__": 92
}, },
"_enabled": true, "_enabled": true,
"__prefab": null, "__prefab": null,
@ -2687,7 +2849,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 95 "__id__": 92
}, },
"_enabled": true, "_enabled": true,
"__prefab": null, "__prefab": null,
@ -2731,10 +2893,10 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 99 "__id__": 96
}, },
{ {
"__id__": 100 "__id__": 97
} }
], ],
"_prefab": null, "_prefab": null,
@ -2771,7 +2933,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 98 "__id__": 95
}, },
"_enabled": true, "_enabled": true,
"__prefab": null, "__prefab": null,
@ -2792,7 +2954,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 98 "__id__": 95
}, },
"_enabled": true, "_enabled": true,
"__prefab": null, "__prefab": null,
@ -2899,7 +3061,7 @@
"_enabled": true, "_enabled": true,
"__prefab": null, "__prefab": null,
"_cameraComponent": { "_cameraComponent": {
"__id__": 101 "__id__": 98
}, },
"_alignCanvasWithScreen": true, "_alignCanvasWithScreen": true,
"_id": "12O/ljcVlEqLmVm3U2gEOQ" "_id": "12O/ljcVlEqLmVm3U2gEOQ"
@ -2943,7 +3105,7 @@
"_enabled": true, "_enabled": true,
"__prefab": null, "__prefab": null,
"virtualJoystic": { "virtualJoystic": {
"__id__": 72 "__id__": 80
}, },
"player": null, "player": null,
"haloProjectileLauncherComponent": { "haloProjectileLauncherComponent": {
@ -2965,16 +3127,16 @@
"__id__": 43 "__id__": 43
}, },
"camera": { "camera": {
"__id__": 101 "__id__": 98
}, },
"gameUI": { "gameUI": {
"__id__": 74 "__id__": 82
}, },
"background": { "background": {
"__id__": 17 "__id__": 17
}, },
"modalWindowManager": { "modalWindowManager": {
"__id__": 88 "__id__": 85
}, },
"gameAudioAdapter": { "gameAudioAdapter": {
"__id__": 14 "__id__": 14
@ -2986,7 +3148,7 @@
"fileId": "cffa5b19-2043-4cef-8221-1a10ab7a2c1f", "fileId": "cffa5b19-2043-4cef-8221-1a10ab7a2c1f",
"targetOverrides": [ "targetOverrides": [
{ {
"__id__": 107 "__id__": 104
} }
], ],
"nestedPrefabInstanceRoots": [ "nestedPrefabInstanceRoots": [
@ -2995,16 +3157,13 @@
}, },
{ {
"__id__": 26 "__id__": 26
},
{
"__id__": 76
} }
] ]
}, },
{ {
"__type__": "cc.TargetOverrideInfo", "__type__": "cc.TargetOverrideInfo",
"source": { "source": {
"__id__": 105 "__id__": 102
}, },
"sourceInfo": null, "sourceInfo": null,
"propertyPath": [ "propertyPath": [
@ -3014,7 +3173,7 @@
"__id__": 26 "__id__": 26
}, },
"targetInfo": { "targetInfo": {
"__id__": 108 "__id__": 105
} }
}, },
{ {
@ -3026,19 +3185,19 @@
{ {
"__type__": "cc.SceneGlobals", "__type__": "cc.SceneGlobals",
"ambient": { "ambient": {
"__id__": 110 "__id__": 107
}, },
"shadows": { "shadows": {
"__id__": 111 "__id__": 108
}, },
"_skybox": { "_skybox": {
"__id__": 112 "__id__": 109
}, },
"fog": { "fog": {
"__id__": 113 "__id__": 110
}, },
"octree": { "octree": {
"__id__": 114 "__id__": 111
} }
}, },
{ {

View File

@ -24,11 +24,11 @@
"_active": true, "_active": true,
"_components": [], "_components": [],
"_prefab": { "_prefab": {
"__id__": 36 "__id__": 44
}, },
"autoReleaseAssets": false, "autoReleaseAssets": false,
"_globals": { "_globals": {
"__id__": 37 "__id__": 45
}, },
"_id": "1a3bccb5-bbb7-4058-846c-ed41b52415b0" "_id": "1a3bccb5-bbb7-4058-846c-ed41b52415b0"
}, },
@ -159,21 +159,24 @@
}, },
{ {
"__id__": 29 "__id__": 29
},
{
"__id__": 37
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 32 "__id__": 40
}, },
{ {
"__id__": 33 "__id__": 41
}, },
{ {
"__id__": 34 "__id__": 42
}, },
{ {
"__id__": 35 "__id__": 43
} }
], ],
"_prefab": null, "_prefab": null,
@ -463,7 +466,7 @@
"__prefab": null, "__prefab": null,
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 100, "width": 150,
"height": 40 "height": 40
}, },
"_anchorPoint": { "_anchorPoint": {
@ -616,7 +619,7 @@
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
"x": 0, "x": 0,
"y": -47, "y": -50,
"z": 0 "z": 0
}, },
"_lrot": { "_lrot": {
@ -757,7 +760,7 @@
"__prefab": null, "__prefab": null,
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 100, "width": 150,
"height": 40 "height": 40
}, },
"_anchorPoint": { "_anchorPoint": {
@ -879,6 +882,300 @@
"__prefab": null, "__prefab": null,
"_id": "17dRwdDH1DH7KDpkjt3c0f" "_id": "17dRwdDH1DH7KDpkjt3c0f"
}, },
{
"__type__": "cc.Node",
"_name": "AudioSettingsBtn",
"_objFlags": 0,
"_parent": {
"__id__": 10
},
"_children": [
{
"__id__": 30
}
],
"_active": true,
"_components": [
{
"__id__": 33
},
{
"__id__": 34
},
{
"__id__": 35
},
{
"__id__": 36
}
],
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": -150,
"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": "0c5QLzfeJIPogjKOYmZj7M"
},
{
"__type__": "cc.Node",
"_name": "Label",
"_objFlags": 512,
"_parent": {
"__id__": 29
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 31
},
{
"__id__": 32
}
],
"_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": "06dRHYuFFP/a/o39V6kbbw"
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 30
},
"_enabled": true,
"__prefab": null,
"_contentSize": {
"__type__": "cc.Size",
"width": 130,
"height": 40
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": "d1d/N7z/tJe6M98lBL8FK6"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 30
},
"_enabled": true,
"__prefab": null,
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_string": "Audio Settings",
"_horizontalAlign": 1,
"_verticalAlign": 1,
"_actualFontSize": 20,
"_fontSize": 20,
"_fontFamily": "Arial",
"_lineHeight": 40,
"_overflow": 1,
"_enableWrapText": false,
"_font": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_isItalic": false,
"_isBold": false,
"_isUnderline": false,
"_underlineHeight": 2,
"_cacheMode": 0,
"_id": "0foNkZgxJJWKhv+kjV9A9W"
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 29
},
"_enabled": true,
"__prefab": null,
"_contentSize": {
"__type__": "cc.Size",
"width": 150,
"height": 40
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": "7bkG6d1QxEc70rQblThaFd"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 29
},
"_enabled": true,
"__prefab": null,
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 1,
"_fillType": 0,
"_sizeMode": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": "adjFoug+ZHY7G2QNG0o7tk"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 29
},
"_enabled": true,
"__prefab": null,
"clickEvents": [],
"_interactable": true,
"_transition": 2,
"_normalColor": {
"__type__": "cc.Color",
"r": 214,
"g": 214,
"b": 214,
"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": {
"__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_hoverSprite": {
"__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_pressedSprite": {
"__uuid__": "544e49d6-3f05-4fa8-9a9e-091f98fc2ce8@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_disabledSprite": {
"__uuid__": "951249e0-9f16-456d-8b85-a6ca954da16b@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_duration": 0.1,
"_zoomScale": 1.2,
"_target": {
"__id__": 29
},
"_id": "83MUZ70BBPoqpCJzA3nVTN"
},
{
"__type__": "55e5f5nQ8dHiL5fPWjgdXbH",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 29
},
"_enabled": true,
"__prefab": null,
"_id": "32FMfxdN1Auo3dMG2+/Ftl"
},
{ {
"__type__": "cc.Node", "__type__": "cc.Node",
"_name": "ModalWindowManager", "_name": "ModalWindowManager",
@ -890,10 +1187,10 @@
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 30 "__id__": 38
}, },
{ {
"__id__": 31 "__id__": 39
} }
], ],
"_prefab": null, "_prefab": null,
@ -930,7 +1227,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 29 "__id__": 37
}, },
"_enabled": true, "_enabled": true,
"__prefab": null, "__prefab": null,
@ -951,7 +1248,7 @@
"_name": "", "_name": "",
"_objFlags": 0, "_objFlags": 0,
"node": { "node": {
"__id__": 29 "__id__": 37
}, },
"_enabled": true, "_enabled": true,
"__prefab": null, "__prefab": null,
@ -959,6 +1256,10 @@
{ {
"__uuid__": "0b35c4ba-253d-4316-ad01-0ba40a2612fc", "__uuid__": "0b35c4ba-253d-4316-ad01-0ba40a2612fc",
"__expectedType__": "cc.Prefab" "__expectedType__": "cc.Prefab"
},
{
"__uuid__": "9f66fba0-82b2-481c-835d-41cb87f38d87",
"__expectedType__": "cc.Prefab"
} }
], ],
"_id": "16B4Ez0O1Ob7mNngLSL2Y/" "_id": "16B4Ez0O1Ob7mNngLSL2Y/"
@ -1043,8 +1344,11 @@
"upgradeBtn": { "upgradeBtn": {
"__id__": 28 "__id__": 28
}, },
"audioSettingsBtn": {
"__id__": 36
},
"modalWindowManager": { "modalWindowManager": {
"__id__": 31 "__id__": 39
}, },
"_id": "4cQFnvx1xB65sFsTPGRrB7" "_id": "4cQFnvx1xB65sFsTPGRrB7"
}, },
@ -1060,19 +1364,19 @@
{ {
"__type__": "cc.SceneGlobals", "__type__": "cc.SceneGlobals",
"ambient": { "ambient": {
"__id__": 38 "__id__": 46
}, },
"shadows": { "shadows": {
"__id__": 39 "__id__": 47
}, },
"_skybox": { "_skybox": {
"__id__": 40 "__id__": 48
}, },
"fog": { "fog": {
"__id__": 41 "__id__": 49
}, },
"octree": { "octree": {
"__id__": 42 "__id__": 50
} }
}, },
{ {

View File

@ -1,6 +1,7 @@
import { Component, director, JsonAsset, _decorator } from "cc"; import { Component, director, JsonAsset, _decorator } from "cc";
import { GameSettings } from "../Game/Data/GameSettings"; import { GameSettings } from "../Game/Data/GameSettings";
import { TranslationData } from "../Game/Data/TranslationData"; import { TranslationData } from "../Game/Data/TranslationData";
import { UserData } from "../Game/Data/UserData";
import { AudioPlayer } from "../Services/AudioPlayer/AudioPlayer"; import { AudioPlayer } from "../Services/AudioPlayer/AudioPlayer";
import { SaveSystem } from "./SaveSystem"; import { SaveSystem } from "./SaveSystem";
const { ccclass, property } = _decorator; const { ccclass, property } = _decorator;
@ -14,6 +15,8 @@ export class AppRoot extends Component {
private static instance: AppRoot; private static instance: AppRoot;
private saveSystem: SaveSystem; private saveSystem: SaveSystem;
private liveUserData: UserData;
public static get Instance(): AppRoot { public static get Instance(): AppRoot {
return this.instance; return this.instance;
} }
@ -22,8 +25,8 @@ export class AppRoot extends Component {
return this.audio; return this.audio;
} }
public get SaveSystem(): SaveSystem { public get LiveUserData(): UserData {
return this.saveSystem; return this.liveUserData;
} }
public get Settings(): GameSettings { public get Settings(): GameSettings {
@ -34,6 +37,10 @@ export class AppRoot extends Component {
return <TranslationData>this.engTranslationAsset.json; return <TranslationData>this.engTranslationAsset.json;
} }
public saveUserData(): void {
this.saveSystem.save(this.liveUserData);
}
public start(): void { public start(): void {
if (AppRoot.Instance == null) { if (AppRoot.Instance == null) {
AppRoot.instance = this; AppRoot.instance = this;
@ -46,6 +53,8 @@ export class AppRoot extends Component {
private init(): void { private init(): void {
this.saveSystem = new SaveSystem(); this.saveSystem = new SaveSystem();
this.audio.init(1, 1); this.liveUserData = this.saveSystem.load();
this.audio.init(this.LiveUserData.soundVolume, this.LiveUserData.musicVolume);
} }
} }

View File

@ -32,6 +32,8 @@ const { ccclass, property } = _decorator;
@ccclass("Game") @ccclass("Game")
export class Game extends Component { export class Game extends Component {
private static instance: Game;
@property(VirtualJoystic) private virtualJoystic: VirtualJoystic; @property(VirtualJoystic) private virtualJoystic: VirtualJoystic;
@property(Player) private player: Player; @property(Player) private player: Player;
@property(ProjectileLauncher) private haloProjectileLauncherComponent: ProjectileLauncher; @property(ProjectileLauncher) private haloProjectileLauncherComponent: ProjectileLauncher;
@ -54,8 +56,8 @@ export class Game extends Component {
private enemyProjectileLauncher: EnemyProjectileLauncher; private enemyProjectileLauncher: EnemyProjectileLauncher;
private gamePauser: Pauser = new Pauser(); private gamePauser: Pauser = new Pauser();
private gameResult: GameResult;
private static instance: Game;
private timeAlive = 0; private timeAlive = 0;
public static get Instance(): Game { public static get Instance(): Game {
@ -73,7 +75,7 @@ export class Game extends Component {
translationData: TranslationData, translationData: TranslationData,
testValues?: TestValues testValues?: TestValues
): Promise<GameResult> { ): Promise<GameResult> {
const gameResult = new GameResult(); this.gameResult = new GameResult();
const metaUpgrades = new MetaUpgrades(userData.game.metaUpgrades, settings.metaUpgrades); const metaUpgrades = new MetaUpgrades(userData.game.metaUpgrades, settings.metaUpgrades);
this.virtualJoystic.init(); this.virtualJoystic.init();
@ -84,7 +86,7 @@ export class Game extends Component {
this.player.init(multiInput, this.createPlayerData(settings.player, metaUpgrades)); this.player.init(multiInput, this.createPlayerData(settings.player, metaUpgrades));
this.enemyManager.init(this.player.node, settings.enemyManager); this.enemyManager.init(this.player.node, settings.enemyManager);
this.itemManager.init(this.enemyManager, this.player, gameResult, settings.items); this.itemManager.init(this.enemyManager, this.player, this.gameResult, settings.items);
this.playerCollisionSystem = new PlayerCollisionSystem(this.player, settings.player.collisionDelay, this.itemManager); this.playerCollisionSystem = new PlayerCollisionSystem(this.player, settings.player.collisionDelay, this.itemManager);
new WeaponCollisionSystem(this.player.Weapon); new WeaponCollisionSystem(this.player.Weapon);
@ -132,9 +134,9 @@ export class Game extends Component {
this.diagonalProjectileLauncher, this.diagonalProjectileLauncher,
settings.upgrades settings.upgrades
); );
new GameModalLauncher(this.modalWindowManager, this.player, this.gamePauser, upgrader, translationData); const modalLauncher = new GameModalLauncher(this.modalWindowManager, this.player, this.gamePauser, upgrader, translationData);
this.gameUI.init(this.player); this.gameUI.init(this.player, modalLauncher);
this.background.init(this.player.node); this.background.init(this.player.node);
if (testValues) { if (testValues) {
@ -145,11 +147,18 @@ export class Game extends Component {
this.gameAudioAdapter.init(this.enemyManager); this.gameAudioAdapter.init(this.enemyManager);
this.gamePauser.resume(); this.gamePauser.resume();
while (this.player.Health.IsAlive) await delay(100); while (!this.gameResult.hasExitManually && this.player.Health.IsAlive) await delay(100);
if (!this.gameResult.hasExitManually) {
await delay(1000);
}
this.gamePauser.pause(); this.gamePauser.pause();
Game.instance = null; Game.instance = null;
gameResult.score = this.timeAlive; this.gameResult.score = this.timeAlive;
return gameResult; return this.gameResult;
}
public exitGame(): void {
this.gameResult.hasExitManually = true;
} }
public update(deltaTime: number): void { public update(deltaTime: number): void {
@ -188,6 +197,7 @@ export class Game extends Component {
} }
export class GameResult { export class GameResult {
public hasExitManually = false;
public goldCoins = 0; public goldCoins = 0;
public score = 0; public score = 0;
} }

View File

@ -1,5 +1,8 @@
import { MenuModalWindowTypes } from "../../Menu/ModalWindows/MenuModalWindowTypes";
import { Empty } from "../../Menu/ModalWindows/Upgrades/UpgradesModalWindow";
import { ModalWindowManager } from "../../Services/ModalWindowSystem/ModalWindowManager"; import { ModalWindowManager } from "../../Services/ModalWindowSystem/ModalWindowManager";
import { TranslationData } from "../Data/TranslationData"; import { TranslationData } from "../Data/TranslationData";
import { Game } from "../Game";
import { Pauser } from "../Pauser"; import { Pauser } from "../Pauser";
import { LevelUpModalWindowParams } from "../UI/LevelUpWindow/LevelUpModalWindow"; import { LevelUpModalWindowParams } from "../UI/LevelUpWindow/LevelUpModalWindow";
import { Player } from "../Unit/Player/Player"; import { Player } from "../Unit/Player/Player";
@ -27,4 +30,15 @@ export class GameModalLauncher {
this.gamePauser.resume(); this.gamePauser.resume();
this.upgrader.upgradeSkill(skillToUpgrade); this.upgrader.upgradeSkill(skillToUpgrade);
} }
public async showPauseModal(): Promise<void> {
this.gamePauser.pause();
const shouldExit = await this.modalWindowManager.showModal<ModalWindowManager, boolean>(GameModalWindowTypes.Pause, this.modalWindowManager);
if (shouldExit) {
Game.Instance.exitGame();
} else {
this.gamePauser.resume();
}
}
} }

View File

@ -1,3 +1,4 @@
export enum GameModalWindowTypes { export enum GameModalWindowTypes {
LevelUp = "LevelUpModalWindow" LevelUp = "LevelUpModalWindow",
Pause = "PauseModalWindow"
} }

View File

@ -0,0 +1,36 @@
import { _decorator } from "cc";
import { MenuModalWindowTypes } from "../../Menu/ModalWindows/MenuModalWindowTypes";
import { ModalWindow } from "../../Services/ModalWindowSystem/ModalWindow";
import { ModalWindowManager } from "../../Services/ModalWindowSystem/ModalWindowManager";
import { UIButton } from "../../Services/UI/Button/UIButton";
const { ccclass, property } = _decorator;
@ccclass("PauseModalWindow")
export class PauseModalWindow extends ModalWindow<ModalWindowManager, boolean> {
@property(UIButton) private continueBtn: UIButton;
@property(UIButton) private audioSettingsButton: UIButton;
@property(UIButton) private exitBtn: UIButton;
private modalWindowManager: ModalWindowManager;
protected setup(modalWindowManager: ModalWindowManager): void {
this.modalWindowManager = modalWindowManager;
this.continueBtn.InteractedEvent.on(this.continueGame, this);
this.audioSettingsButton.InteractedEvent.on(this.openSettingsWindow, this);
this.exitBtn.InteractedEvent.on(this.exitGame, this);
}
private openSettingsWindow(): void {
this.modalWindowManager.showModal(MenuModalWindowTypes.AudioSettings, {});
}
private continueGame(): void {
this.dismiss(false);
}
private exitGame(): void {
this.dismiss(true);
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "7951e831-768d-4cc1-910f-d93b9038b3aa",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -1,4 +1,6 @@
import { Component, Label, ProgressBar, _decorator } from "cc"; import { Component, Label, ProgressBar, _decorator } from "cc";
import { UIButton } from "../../Services/UI/Button/UIButton";
import { GameModalLauncher } from "../ModalWIndows/GameModalLauncher";
import { Player } from "../Unit/Player/Player"; import { Player } from "../Unit/Player/Player";
import { UnitLevel } from "../Unit/UnitLevel"; import { UnitLevel } from "../Unit/UnitLevel";
@ -8,20 +10,31 @@ const { ccclass, property } = _decorator;
export class GameUI extends Component { export class GameUI extends Component {
@property(ProgressBar) private xpBar: ProgressBar; @property(ProgressBar) private xpBar: ProgressBar;
@property(Label) private timeAliveText: Label; @property(Label) private timeAliveText: Label;
@property(UIButton) private pauseBtn: UIButton;
private playerLevel: UnitLevel; private playerLevel: UnitLevel;
private modalLauncher: GameModalLauncher;
public init(player: Player): void { public init(player: Player, modalLauncher: GameModalLauncher): void {
this.playerLevel = player.Level; this.playerLevel = player.Level;
this.modalLauncher = modalLauncher;
this.playerLevel.XpAddedEvent.on(this.updateProgressBar, this); this.playerLevel.XpAddedEvent.on(this.updateProgressBar, this);
this.playerLevel.LevelUpEvent.on(this.updateProgressBar, this); this.playerLevel.LevelUpEvent.on(this.updateProgressBar, this);
this.xpBar.progress = 0; this.xpBar.progress = 0;
this.pauseBtn.InteractedEvent.on(this.showPauseWindow, this);
} }
private updateProgressBar(): void { private updateProgressBar(): void {
this.xpBar.progress = this.playerLevel.XP / this.playerLevel.RequiredXP; this.xpBar.progress = this.playerLevel.XP / this.playerLevel.RequiredXP;
} }
private showPauseWindow(): void {
console.log("Show pause window");
this.modalLauncher.showPauseModal();
}
public updateTimeAlive(timeAlive: number): void { public updateTimeAlive(timeAlive: number): void {
this.timeAliveText.string = `${Math.floor(timeAlive)}`; this.timeAliveText.string = `${Math.floor(timeAlive)}`;
} }

View File

@ -14,7 +14,7 @@ export class LevelUpSkill extends Component {
public init(skillType: UpgradeType, translationData: TranslationData): void { public init(skillType: UpgradeType, translationData: TranslationData): void {
this.skillType = skillType; this.skillType = skillType;
this.skillTitle.string = `${translationData[`${skillType}_TITLE`]}`; this.skillTitle.string = `${translationData[`${skillType}_TITLE`]}`;
this.node.on(NodeEventType.MOUSE_DOWN, this.chooseSkill, this); this.node.on(NodeEventType.TOUCH_START, this.chooseSkill, this);
} }
public get ChooseSkillEvent(): ISignal<UpgradeType> { public get ChooseSkillEvent(): ISignal<UpgradeType> {

View File

@ -23,7 +23,7 @@ export class GameRunner {
public async playGame(): Promise<void> { public async playGame(): Promise<void> {
this.isRunning = true; this.isRunning = true;
director.loadScene("Game"); director.loadScene("Game");
const userData: UserData = AppRoot.Instance.SaveSystem.load(); const userData: UserData = AppRoot.Instance.LiveUserData;
while (Game.Instance == null) await delay(10); while (Game.Instance == null) await delay(10);
const result: GameResult = await Game.Instance.playGame(userData, AppRoot.Instance.Settings, AppRoot.Instance.TranslationData); const result: GameResult = await Game.Instance.playGame(userData, AppRoot.Instance.Settings, AppRoot.Instance.TranslationData);
userData.game.goldCoins += result.goldCoins; userData.game.goldCoins += result.goldCoins;
@ -31,9 +31,7 @@ export class GameRunner {
if (userData.game.highscore < result.score) { if (userData.game.highscore < result.score) {
userData.game.highscore = result.score; userData.game.highscore = result.score;
} }
AppRoot.Instance.SaveSystem.save(userData); AppRoot.Instance.saveUserData();
await delay(1000);
director.loadScene("Menu"); director.loadScene("Menu");
this.isRunning = false; this.isRunning = false;

View File

@ -10,6 +10,7 @@ const { ccclass, property } = _decorator;
export class Menu extends Component { export class Menu extends Component {
@property(UIButton) private playBtn: UIButton; @property(UIButton) private playBtn: UIButton;
@property(UIButton) private upgradeBtn: UIButton; @property(UIButton) private upgradeBtn: UIButton;
@property(UIButton) private audioSettingsBtn: UIButton;
@property(ModalWindowManager) private modalWindowManager: ModalWindowManager; @property(ModalWindowManager) private modalWindowManager: ModalWindowManager;
private menuModalLauncher: MenuModalLauncher; private menuModalLauncher: MenuModalLauncher;
@ -17,6 +18,7 @@ export class Menu extends Component {
public async start(): Promise<void> { public async start(): Promise<void> {
this.playBtn.InteractedEvent.on(this.startGame, this); this.playBtn.InteractedEvent.on(this.startGame, this);
this.upgradeBtn.InteractedEvent.on(this.openUpgradesWindow, this); this.upgradeBtn.InteractedEvent.on(this.openUpgradesWindow, this);
this.audioSettingsBtn.InteractedEvent.on(this.openAudioSettingsWindow, this);
this.menuModalLauncher = new MenuModalLauncher(this.modalWindowManager); this.menuModalLauncher = new MenuModalLauncher(this.modalWindowManager);
} }
@ -28,4 +30,8 @@ export class Menu extends Component {
private openUpgradesWindow(): void { private openUpgradesWindow(): void {
this.menuModalLauncher.openUpgradesWindow(); this.menuModalLauncher.openUpgradesWindow();
} }
private openAudioSettingsWindow(): void {
this.menuModalLauncher.openAudioSettingsWindow();
}
} }

View File

@ -0,0 +1,12 @@
{
"ver": "1.1.0",
"importer": "directory",
"imported": true,
"uuid": "fcf86181-bba6-488b-b46a-4fbc6c162992",
"files": [],
"subMetas": {},
"userData": {
"compressionType": {},
"isRemoteBundle": {}
}
}

View File

@ -0,0 +1,40 @@
import { Slider, _decorator } from "cc";
import { AppRoot } from "../../../AppRoot/AppRoot";
import { ModalWindow } from "../../../Services/ModalWindowSystem/ModalWindow";
import { UIButton } from "../../../Services/UI/Button/UIButton";
import { Empty } from "../Upgrades/UpgradesModalWindow";
const { ccclass, property } = _decorator;
@ccclass("AudioSettingsModalWindow")
export class AudioSettingsModalWindow extends ModalWindow<Empty, Empty> {
@property(Slider) private soundVolumeSlider: Slider;
@property(Slider) private musicVolumeSlider: Slider;
@property(UIButton) private okButton: UIButton;
protected setup(): void {
this.soundVolumeSlider.progress = AppRoot.Instance.AudioPlayer.SoundVolume;
this.musicVolumeSlider.progress = AppRoot.Instance.AudioPlayer.MusicVolume;
this.soundVolumeSlider.node.on("slide", this.updateSoundVolume, this);
this.musicVolumeSlider.node.on("slide", this.updateMusicVolume, this);
this.okButton.InteractedEvent.on(this.dismiss, this);
}
private updateSoundVolume(): void {
AppRoot.Instance.AudioPlayer.setSoundVolume(this.soundVolumeSlider.progress);
}
private updateMusicVolume(): void {
AppRoot.Instance.AudioPlayer.setMusicVolume(this.musicVolumeSlider.progress);
}
protected dismiss(result?: Empty): void {
super.dismiss(result);
const userData = AppRoot.Instance.LiveUserData;
userData.musicVolume = this.musicVolumeSlider.progress;
userData.soundVolume = this.soundVolumeSlider.progress;
AppRoot.Instance.saveUserData();
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "0c052d4f-c82c-4aff-a5ed-a7317f69c9ef",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -7,4 +7,8 @@ export class MenuModalLauncher {
public async openUpgradesWindow(): Promise<void> { public async openUpgradesWindow(): Promise<void> {
await this.modalWindowManager.showModal(MenuModalWindowTypes.Upgrades, {}); await this.modalWindowManager.showModal(MenuModalWindowTypes.Upgrades, {});
} }
public async openAudioSettingsWindow(): Promise<void> {
await this.modalWindowManager.showModal(MenuModalWindowTypes.AudioSettings, {});
}
} }

View File

@ -1,3 +1,4 @@
export enum MenuModalWindowTypes { export enum MenuModalWindowTypes {
Upgrades = "UpgradesModalWindow" Upgrades = "UpgradesModalWindow",
AudioSettings = "AudioSettingsModalWindow"
} }

View File

@ -22,7 +22,7 @@ export class UpgradesModalWindow extends ModalWindow<Empty, Empty> {
private userData: UserData; private userData: UserData;
public setup(): void { public setup(): void {
this.userData = AppRoot.Instance.SaveSystem.load(); this.userData = AppRoot.Instance.LiveUserData;
const settings = AppRoot.Instance.Settings.metaUpgrades; const settings = AppRoot.Instance.Settings.metaUpgrades;
this.createUpgradeButton(MetaUpgradeType.Health, settings.health, "healthLevel"); this.createUpgradeButton(MetaUpgradeType.Health, settings.health, "healthLevel");
@ -67,7 +67,7 @@ export class UpgradesModalWindow extends ModalWindow<Empty, Empty> {
this.typeToUpgradeUI.get(upgradeType).updateLevel(level); this.typeToUpgradeUI.get(upgradeType).updateLevel(level);
this.goldCoinsLabel.string = this.userData.game.goldCoins.toString(); this.goldCoinsLabel.string = this.userData.game.goldCoins.toString();
AppRoot.Instance.SaveSystem.save(this.userData); AppRoot.Instance.saveUserData;
} }
} }

View File

@ -11,6 +11,14 @@ export class AudioPlayer extends Component {
this.setMusicVolume(musicVolume); this.setMusicVolume(musicVolume);
} }
public get SoundVolume(): number {
return this.soundSource.volume;
}
public get MusicVolume(): number {
return this.musicSource.volume;
}
public setSoundVolume(volume: number): void { public setSoundVolume(volume: number): void {
this.soundSource.volume = volume; this.soundSource.volume = volume;
} }