From c85345cba0a580bbf2752ebf86397e41e0776e7c Mon Sep 17 00:00:00 2001 From: Martin Date: Fri, 16 Dec 2022 12:20:37 +0100 Subject: [PATCH] Upgrades ui --- assets/Media/Materials/builtin-sprite.effect | 91 ++++++ .../Materials/builtin-sprite.effect.meta | 1 + assets/Media/Prefabs/Menu.meta | 12 - .../Prefabs/Menu/UpgradeLevelPointUI.prefab | 142 --------- .../UI.meta => ModalWindows/LevelUp.meta} | 2 +- .../{ => LevelUp}/LevelUpModalWindow.prefab | 0 .../LevelUpModalWindow.prefab.meta | 0 .../LevelUp}/LevelUpSkill.prefab | 0 .../LevelUp}/LevelUpSkill.prefab.meta | 0 .../Upgrades.meta} | 2 +- .../Upgrades}/UpgradeButton.prefab | 176 +++++++++-- .../Upgrades}/UpgradeButton.prefab.meta | 0 .../Upgrades/UpgradeLevelPointUI.prefab | 298 ++++++++++++++++++ .../Upgrades}/UpgradeLevelPointUI.prefab.meta | 0 .../{ => Upgrades}/UpgradesModalWindow.prefab | 0 .../UpgradesModalWindow.prefab.meta | 0 .../Upgrades/UpgradeLevelPointUI.ts | 15 + .../Upgrades/UpgradeLevelPointUI.ts.meta | 9 + .../Menu/ModalWindows/Upgrades/UpgradeUI.ts | 9 + 19 files changed, 582 insertions(+), 175 deletions(-) create mode 100644 assets/Media/Materials/builtin-sprite.effect create mode 100644 assets/Media/Materials/builtin-sprite.effect.meta delete mode 100644 assets/Media/Prefabs/Menu.meta delete mode 100644 assets/Media/Prefabs/Menu/UpgradeLevelPointUI.prefab rename assets/Media/Prefabs/{Game/UI.meta => ModalWindows/LevelUp.meta} (77%) rename assets/Media/Prefabs/ModalWindows/{ => LevelUp}/LevelUpModalWindow.prefab (100%) rename assets/Media/Prefabs/ModalWindows/{ => LevelUp}/LevelUpModalWindow.prefab.meta (100%) rename assets/Media/Prefabs/{Game/UI/LevelUpModalWindow => ModalWindows/LevelUp}/LevelUpSkill.prefab (100%) rename assets/Media/Prefabs/{Game/UI/LevelUpModalWindow => ModalWindows/LevelUp}/LevelUpSkill.prefab.meta (100%) rename assets/Media/Prefabs/{Game/UI/LevelUpModalWindow.meta => ModalWindows/Upgrades.meta} (77%) rename assets/Media/Prefabs/{Menu => ModalWindows/Upgrades}/UpgradeButton.prefab (81%) rename assets/Media/Prefabs/{Menu => ModalWindows/Upgrades}/UpgradeButton.prefab.meta (100%) create mode 100644 assets/Media/Prefabs/ModalWindows/Upgrades/UpgradeLevelPointUI.prefab rename assets/Media/Prefabs/{Menu => ModalWindows/Upgrades}/UpgradeLevelPointUI.prefab.meta (100%) rename assets/Media/Prefabs/ModalWindows/{ => Upgrades}/UpgradesModalWindow.prefab (100%) rename assets/Media/Prefabs/ModalWindows/{ => Upgrades}/UpgradesModalWindow.prefab.meta (100%) create mode 100644 assets/Scripts/Menu/ModalWindows/Upgrades/UpgradeLevelPointUI.ts create mode 100644 assets/Scripts/Menu/ModalWindows/Upgrades/UpgradeLevelPointUI.ts.meta diff --git a/assets/Media/Materials/builtin-sprite.effect b/assets/Media/Materials/builtin-sprite.effect new file mode 100644 index 0000000..86e1d95 --- /dev/null +++ b/assets/Media/Materials/builtin-sprite.effect @@ -0,0 +1,91 @@ +// Copyright (c) 2017-2020 Xiamen Yaji Software Co., Ltd. +CCEffect %{ + techniques: + - passes: + - vert: sprite-vs:vert + frag: sprite-fs:frag + depthStencilState: + depthTest: false + depthWrite: false + blendState: + targets: + - blend: true + blendSrc: src_alpha + blendDst: one_minus_src_alpha + blendDstAlpha: one_minus_src_alpha + rasterizerState: + cullMode: none + properties: + alphaThreshold: { value: 0.5 } +}% + +CCProgram sprite-vs %{ + precision highp float; + #include + #if USE_LOCAL + #include + #endif + #if SAMPLE_FROM_RT + #include + #endif + in vec3 a_position; + in vec2 a_texCoord; + in vec4 a_color; + + out vec4 color; + out vec2 uv0; + + vec4 vert () { + vec4 pos = vec4(a_position, 1); + + #if USE_LOCAL + pos = cc_matWorld * pos; + #endif + + #if USE_PIXEL_ALIGNMENT + pos = cc_matView * pos; + pos.xyz = floor(pos.xyz); + pos = cc_matProj * pos; + #else + pos = cc_matViewProj * pos; + #endif + + uv0 = a_texCoord; + #if SAMPLE_FROM_RT + CC_HANDLE_RT_SAMPLE_FLIP(uv0); + #endif + color = a_color; + + return pos; + } +}% + +CCProgram sprite-fs %{ + precision highp float; + #include + #include + + in vec4 color; + + #if USE_TEXTURE + in vec2 uv0; + #pragma builtin(local) + layout(set = 2, binding = 11) uniform sampler2D cc_spriteTexture; + #endif + + vec4 frag () { + vec4 o = vec4(1, 1, 1, 1); + + #if USE_TEXTURE + o *= CCSampleWithAlphaSeparated(cc_spriteTexture, uv0); + #if IS_GRAY + float gray = 0.2126 * o.r + 0.7152 * o.g + 0.0722 * o.b; + o.r = o.g = o.b = gray; + #endif + #endif + + o *= color; + ALPHA_TEST(o); + return o; + } +}% diff --git a/assets/Media/Materials/builtin-sprite.effect.meta b/assets/Media/Materials/builtin-sprite.effect.meta new file mode 100644 index 0000000..01736b0 --- /dev/null +++ b/assets/Media/Materials/builtin-sprite.effect.meta @@ -0,0 +1 @@ +{"ver":"1.6.0","importer":"effect","imported":true,"uuid":"3c0cc5ba-c2cb-4948-a991-ea3b91b58798","files":[".json"],"subMetas":{},"userData":{"combinations":[{}]}} diff --git a/assets/Media/Prefabs/Menu.meta b/assets/Media/Prefabs/Menu.meta deleted file mode 100644 index 449127e..0000000 --- a/assets/Media/Prefabs/Menu.meta +++ /dev/null @@ -1,12 +0,0 @@ -{ - "ver": "1.1.0", - "importer": "directory", - "imported": true, - "uuid": "63c984ff-f414-4b17-947c-cf8c6e809a4e", - "files": [], - "subMetas": {}, - "userData": { - "compressionType": {}, - "isRemoteBundle": {} - } -} diff --git a/assets/Media/Prefabs/Menu/UpgradeLevelPointUI.prefab b/assets/Media/Prefabs/Menu/UpgradeLevelPointUI.prefab deleted file mode 100644 index d19c218..0000000 --- a/assets/Media/Prefabs/Menu/UpgradeLevelPointUI.prefab +++ /dev/null @@ -1,142 +0,0 @@ -[ - { - "__type__": "cc.Prefab", - "_name": "UpgradeLevelPointUI", - "_objFlags": 0, - "_native": "", - "data": { - "__id__": 1 - }, - "optimizationPolicy": 0, - "persistent": false, - "asyncLoadAssets": false - }, - { - "__type__": "cc.Node", - "_name": "UpgradeLevelPointUI", - "_objFlags": 0, - "__editorExtras__": {}, - "_parent": null, - "_children": [], - "_active": true, - "_components": [ - { - "__id__": 2 - }, - { - "__id__": 4 - } - ], - "_prefab": { - "__id__": 6 - }, - "_lpos": { - "__type__": "cc.Vec3", - "x": -12.5, - "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": "" - }, - { - "__type__": "cc.UITransform", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 1 - }, - "_enabled": true, - "__prefab": { - "__id__": 3 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 20, - "height": 20 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0.5 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "b52eZzV09InJK+jo6LzLIQ" - }, - { - "__type__": "cc.Sprite", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 1 - }, - "_enabled": true, - "__prefab": { - "__id__": 5 - }, - "_customMaterial": null, - "_srcBlendFactor": 2, - "_dstBlendFactor": 4, - "_color": { - "__type__": "cc.Color", - "r": 255, - "g": 255, - "b": 255, - "a": 255 - }, - "_spriteFrame": { - "__uuid__": "0a917d5c-2810-46e1-8332-63f00395d63a@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": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "b0oW25W9NI85/atu15qR76" - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 1 - }, - "asset": { - "__id__": 0 - }, - "fileId": "d316td07RIIriz5Jc4fIFq" - } -] \ No newline at end of file diff --git a/assets/Media/Prefabs/Game/UI.meta b/assets/Media/Prefabs/ModalWindows/LevelUp.meta similarity index 77% rename from assets/Media/Prefabs/Game/UI.meta rename to assets/Media/Prefabs/ModalWindows/LevelUp.meta index c31d68e..3d85af9 100644 --- a/assets/Media/Prefabs/Game/UI.meta +++ b/assets/Media/Prefabs/ModalWindows/LevelUp.meta @@ -2,7 +2,7 @@ "ver": "1.1.0", "importer": "directory", "imported": true, - "uuid": "ce5459a7-0c87-44b9-af63-3a2854b890ca", + "uuid": "c3e15fb0-6bf6-48bd-9a7d-c0bddc1f6030", "files": [], "subMetas": {}, "userData": { diff --git a/assets/Media/Prefabs/ModalWindows/LevelUpModalWindow.prefab b/assets/Media/Prefabs/ModalWindows/LevelUp/LevelUpModalWindow.prefab similarity index 100% rename from assets/Media/Prefabs/ModalWindows/LevelUpModalWindow.prefab rename to assets/Media/Prefabs/ModalWindows/LevelUp/LevelUpModalWindow.prefab diff --git a/assets/Media/Prefabs/ModalWindows/LevelUpModalWindow.prefab.meta b/assets/Media/Prefabs/ModalWindows/LevelUp/LevelUpModalWindow.prefab.meta similarity index 100% rename from assets/Media/Prefabs/ModalWindows/LevelUpModalWindow.prefab.meta rename to assets/Media/Prefabs/ModalWindows/LevelUp/LevelUpModalWindow.prefab.meta diff --git a/assets/Media/Prefabs/Game/UI/LevelUpModalWindow/LevelUpSkill.prefab b/assets/Media/Prefabs/ModalWindows/LevelUp/LevelUpSkill.prefab similarity index 100% rename from assets/Media/Prefabs/Game/UI/LevelUpModalWindow/LevelUpSkill.prefab rename to assets/Media/Prefabs/ModalWindows/LevelUp/LevelUpSkill.prefab diff --git a/assets/Media/Prefabs/Game/UI/LevelUpModalWindow/LevelUpSkill.prefab.meta b/assets/Media/Prefabs/ModalWindows/LevelUp/LevelUpSkill.prefab.meta similarity index 100% rename from assets/Media/Prefabs/Game/UI/LevelUpModalWindow/LevelUpSkill.prefab.meta rename to assets/Media/Prefabs/ModalWindows/LevelUp/LevelUpSkill.prefab.meta diff --git a/assets/Media/Prefabs/Game/UI/LevelUpModalWindow.meta b/assets/Media/Prefabs/ModalWindows/Upgrades.meta similarity index 77% rename from assets/Media/Prefabs/Game/UI/LevelUpModalWindow.meta rename to assets/Media/Prefabs/ModalWindows/Upgrades.meta index b6721a0..e42e94a 100644 --- a/assets/Media/Prefabs/Game/UI/LevelUpModalWindow.meta +++ b/assets/Media/Prefabs/ModalWindows/Upgrades.meta @@ -2,7 +2,7 @@ "ver": "1.1.0", "importer": "directory", "imported": true, - "uuid": "6b4febd9-02c6-407b-83e4-ba4d38a59288", + "uuid": "3e24da81-45db-4a4e-b84d-8e4fdb7d44b8", "files": [], "subMetas": {}, "userData": { diff --git a/assets/Media/Prefabs/Menu/UpgradeButton.prefab b/assets/Media/Prefabs/ModalWindows/Upgrades/UpgradeButton.prefab similarity index 81% rename from assets/Media/Prefabs/Menu/UpgradeButton.prefab rename to assets/Media/Prefabs/ModalWindows/Upgrades/UpgradeButton.prefab index 041b524..d0e47fe 100644 --- a/assets/Media/Prefabs/Menu/UpgradeButton.prefab +++ b/assets/Media/Prefabs/ModalWindows/Upgrades/UpgradeButton.prefab @@ -26,25 +26,28 @@ }, { "__id__": 14 + }, + { + "__id__": 20 } ], "_active": true, "_components": [ - { - "__id__": 20 - }, - { - "__id__": 22 - }, - { - "__id__": 24 - }, { "__id__": 26 + }, + { + "__id__": 28 + }, + { + "__id__": 30 + }, + { + "__id__": 32 } ], "_prefab": { - "__id__": 28 + "__id__": 34 }, "_lpos": { "__type__": "cc.Vec3", @@ -340,7 +343,7 @@ }, { "__type__": "cc.Node", - "_name": "LevelPoints", + "_name": "Cost", "_objFlags": 0, "_parent": { "__id__": 1 @@ -361,7 +364,7 @@ "_lpos": { "__type__": "cc.Vec3", "x": 0, - "y": -63.985, + "y": -33, "z": 0 }, "_lrot": { @@ -397,6 +400,138 @@ "__prefab": { "__id__": 16 }, + "_contentSize": { + "__type__": "cc.Size", + "width": 33.57, + "height": 20 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "fbXhjtUG9CVpcniyjLku3O" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 14 + }, + "_enabled": true, + "__prefab": { + "__id__": 18 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 167, + "b": 34, + "a": 255 + }, + "_string": "300", + "_horizontalAlign": 1, + "_verticalAlign": 1, + "_actualFontSize": 20, + "_fontSize": 20, + "_fontFamily": "Arial", + "_lineHeight": 20, + "_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": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "a4AECYqyxEk5ETjyuIkDrU" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "8ftf2pEX1N57cPayWX0BUw" + }, + { + "__type__": "cc.Node", + "_name": "LevelPoints", + "_objFlags": 0, + "_parent": { + "__id__": 1 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 21 + }, + { + "__id__": 23 + } + ], + "_prefab": { + "__id__": 25 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": -63.985, + "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": "" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 20 + }, + "_enabled": true, + "__prefab": { + "__id__": 22 + }, "_contentSize": { "__type__": "cc.Size", "width": 0, @@ -418,11 +553,11 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 14 + "__id__": 20 }, "_enabled": true, "__prefab": { - "__id__": 18 + "__id__": 24 }, "_resizeMode": 1, "_layoutType": 1, @@ -469,7 +604,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 21 + "__id__": 27 }, "_contentSize": { "__type__": "cc.Size", @@ -496,7 +631,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 23 + "__id__": 29 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -540,14 +675,14 @@ }, "_enabled": true, "__prefab": { - "__id__": 25 + "__id__": 31 }, "levelPointPrefab": { "__uuid__": "41ca6952-fa32-4e38-8d43-eec2e982533c", "__expectedType__": "cc.Prefab" }, "levelPointsParent": { - "__id__": 14 + "__id__": 20 }, "title": { "__id__": 5 @@ -555,6 +690,9 @@ "description": { "__id__": 11 }, + "cost": { + "__id__": 17 + }, "_id": "" }, { @@ -570,7 +708,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 27 + "__id__": 33 }, "clickEvents": [], "_interactable": true, diff --git a/assets/Media/Prefabs/Menu/UpgradeButton.prefab.meta b/assets/Media/Prefabs/ModalWindows/Upgrades/UpgradeButton.prefab.meta similarity index 100% rename from assets/Media/Prefabs/Menu/UpgradeButton.prefab.meta rename to assets/Media/Prefabs/ModalWindows/Upgrades/UpgradeButton.prefab.meta diff --git a/assets/Media/Prefabs/ModalWindows/Upgrades/UpgradeLevelPointUI.prefab b/assets/Media/Prefabs/ModalWindows/Upgrades/UpgradeLevelPointUI.prefab new file mode 100644 index 0000000..074a6f8 --- /dev/null +++ b/assets/Media/Prefabs/ModalWindows/Upgrades/UpgradeLevelPointUI.prefab @@ -0,0 +1,298 @@ +[ + { + "__type__": "cc.Prefab", + "_name": "UpgradeLevelPointUI", + "_objFlags": 0, + "_native": "", + "data": { + "__id__": 1 + }, + "optimizationPolicy": 0, + "persistent": false, + "asyncLoadAssets": false + }, + { + "__type__": "cc.Node", + "_name": "UpgradeLevelPointUI", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": null, + "_children": [ + { + "__id__": 2 + } + ], + "_active": true, + "_components": [ + { + "__id__": 8 + }, + { + "__id__": 10 + }, + { + "__id__": 12 + } + ], + "_prefab": { + "__id__": 14 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": -12.5, + "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": "" + }, + { + "__type__": "cc.Node", + "_name": "UpgradedGraphics", + "_objFlags": 0, + "_parent": { + "__id__": 1 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 3 + }, + { + "__id__": 5 + } + ], + "_prefab": { + "__id__": 7 + }, + "_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": "" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "__prefab": { + "__id__": 4 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 20, + "height": 20 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "13705VGy1EgI77YCh0/dGK" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "__prefab": { + "__id__": 6 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 195, + "g": 139, + "b": 53, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "0a917d5c-2810-46e1-8332-63f00395d63a@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": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "699kaQdiFOVaLq5RRNJWMt" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "5dLwgaQwRNG5BZNvGhc9YF" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 1 + }, + "_enabled": true, + "__prefab": { + "__id__": 9 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 20, + "height": 20 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "b52eZzV09InJK+jo6LzLIQ" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 1 + }, + "_enabled": true, + "__prefab": { + "__id__": 11 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "0a917d5c-2810-46e1-8332-63f00395d63a@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": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "b0oW25W9NI85/atu15qR76" + }, + { + "__type__": "10d0fuUwd1E24b6fVo7KYFK", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 1 + }, + "_enabled": true, + "__prefab": { + "__id__": 13 + }, + "upgradedGraphics": { + "__id__": 2 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "8a4q+RjfdPHJzMdXLPbFju" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "d316td07RIIriz5Jc4fIFq" + } +] \ No newline at end of file diff --git a/assets/Media/Prefabs/Menu/UpgradeLevelPointUI.prefab.meta b/assets/Media/Prefabs/ModalWindows/Upgrades/UpgradeLevelPointUI.prefab.meta similarity index 100% rename from assets/Media/Prefabs/Menu/UpgradeLevelPointUI.prefab.meta rename to assets/Media/Prefabs/ModalWindows/Upgrades/UpgradeLevelPointUI.prefab.meta diff --git a/assets/Media/Prefabs/ModalWindows/UpgradesModalWindow.prefab b/assets/Media/Prefabs/ModalWindows/Upgrades/UpgradesModalWindow.prefab similarity index 100% rename from assets/Media/Prefabs/ModalWindows/UpgradesModalWindow.prefab rename to assets/Media/Prefabs/ModalWindows/Upgrades/UpgradesModalWindow.prefab diff --git a/assets/Media/Prefabs/ModalWindows/UpgradesModalWindow.prefab.meta b/assets/Media/Prefabs/ModalWindows/Upgrades/UpgradesModalWindow.prefab.meta similarity index 100% rename from assets/Media/Prefabs/ModalWindows/UpgradesModalWindow.prefab.meta rename to assets/Media/Prefabs/ModalWindows/Upgrades/UpgradesModalWindow.prefab.meta diff --git a/assets/Scripts/Menu/ModalWindows/Upgrades/UpgradeLevelPointUI.ts b/assets/Scripts/Menu/ModalWindows/Upgrades/UpgradeLevelPointUI.ts new file mode 100644 index 0000000..f3de647 --- /dev/null +++ b/assets/Scripts/Menu/ModalWindows/Upgrades/UpgradeLevelPointUI.ts @@ -0,0 +1,15 @@ +import { _decorator, Component, Node } from "cc"; +const { ccclass, property } = _decorator; + +@ccclass("UpgradeLevelPointUI") +export class UpgradeLevelPointUI extends Component { + @property(Node) private upgradedGraphics: Node; + + public init(): void { + this.upgradedGraphics.active = false; + } + + public upgrade(): void { + this.upgradedGraphics.active = true; + } +} diff --git a/assets/Scripts/Menu/ModalWindows/Upgrades/UpgradeLevelPointUI.ts.meta b/assets/Scripts/Menu/ModalWindows/Upgrades/UpgradeLevelPointUI.ts.meta new file mode 100644 index 0000000..f3eab63 --- /dev/null +++ b/assets/Scripts/Menu/ModalWindows/Upgrades/UpgradeLevelPointUI.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "4.0.23", + "importer": "typescript", + "imported": true, + "uuid": "10d0fb94-c1dd-44db-86fa-7d5a3b29814a", + "files": [], + "subMetas": {}, + "userData": {} +} diff --git a/assets/Scripts/Menu/ModalWindows/Upgrades/UpgradeUI.ts b/assets/Scripts/Menu/ModalWindows/Upgrades/UpgradeUI.ts index 4f38dba..808d986 100644 --- a/assets/Scripts/Menu/ModalWindows/Upgrades/UpgradeUI.ts +++ b/assets/Scripts/Menu/ModalWindows/Upgrades/UpgradeUI.ts @@ -1,4 +1,5 @@ import { Component, instantiate, Label, Node, Prefab, _decorator } from "cc"; +import { UpgradeLevelPointUI } from "./UpgradeLevelPointUI"; const { ccclass, property } = _decorator; @ccclass("UpgradeUI") @@ -7,14 +8,22 @@ export class UpgradeUI extends Component { @property(Node) private levelPointsParent: Node; @property(Label) private title: Label; @property(Label) private description: Label; + @property(Label) private cost: Label; public init(titleText: string, descriptionText: string, levels: number): void { for (let i = 0; i < levels; i++) { const node: Node = instantiate(this.levelPointPrefab); node.setParent(this.levelPointsParent); + + const levelPointUI = node.getComponent(UpgradeLevelPointUI); + levelPointUI.init(); + if (i < 3) { + levelPointUI.upgrade(); + } } this.title.string = titleText; this.description.string = descriptionText; + this.cost.string = "55"; } }