From 3dd72c13b481806be63b017d92d9ac8219a7b592 Mon Sep 17 00:00:00 2001 From: walkpan Date: Mon, 11 May 2026 15:34:31 +0800 Subject: [PATCH] =?UTF-8?q?refactor(talent):=20=E6=8B=86=E5=88=86=E5=A4=A9?= =?UTF-8?q?=E8=B5=8B=E9=A1=B9=E7=BB=84=E4=BB=B6=E5=B9=B6=E9=80=82=E9=85=8D?= =?UTF-8?q?=E7=B2=BE=E7=81=B5=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将原TalentsComp内的单个天赋项UI更新逻辑抽离为独立的TalentItemComp组件实现代码解耦,更新天赋配置将emoji图标替换为精灵图集资源键,重构TalentsComp的天赋列表渲染逻辑适配新的组件化方案 --- .../gui/element/prefab_talent_item.prefab | 1423 +++++++++++------ assets/script/game/common/config/TalentSet.ts | 22 +- assets/script/game/map/TalentItemComp.ts | 115 ++ assets/script/game/map/TalentItemComp.ts.meta | 9 + assets/script/game/map/TalentsComp.ts | 51 +- 5 files changed, 1059 insertions(+), 561 deletions(-) create mode 100644 assets/script/game/map/TalentItemComp.ts create mode 100644 assets/script/game/map/TalentItemComp.ts.meta diff --git a/assets/resources/gui/element/prefab_talent_item.prefab b/assets/resources/gui/element/prefab_talent_item.prefab index 86efdc79..f7001dfc 100644 --- a/assets/resources/gui/element/prefab_talent_item.prefab +++ b/assets/resources/gui/element/prefab_talent_item.prefab @@ -22,41 +22,44 @@ "__id__": 2 }, { - "__id__": 10 + "__id__": 18 }, { - "__id__": 30 + "__id__": 46 }, { - "__id__": 85 + "__id__": 101 }, { - "__id__": 93 + "__id__": 107 }, { - "__id__": 99 + "__id__": 113 }, { - "__id__": 169 + "__id__": 183 }, { - "__id__": 175 - }, - { - "__id__": 195 - } - ], - "_active": true, - "_components": [ - { - "__id__": 201 + "__id__": 189 }, { "__id__": 203 } ], + "_active": true, + "_components": [ + { + "__id__": 217 + }, + { + "__id__": 219 + }, + { + "__id__": 221 + } + ], "_prefab": { - "__id__": 205 + "__id__": 223 }, "_lpos": { "__type__": "cc.Vec3", @@ -89,27 +92,84 @@ }, { "__type__": "cc.Node", - "_name": "bg_list", + "_name": "bg", "_objFlags": 0, "__editorExtras__": {}, "_parent": { "__id__": 1 }, + "_children": [ + { + "__id__": 3 + } + ], + "_active": true, + "_components": [ + { + "__id__": 11 + }, + { + "__id__": 13 + }, + { + "__id__": 15 + } + ], + "_prefab": { + "__id__": 17 + }, + "_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 + }, + "_mobility": 0, + "_layer": 1073741824, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "" + }, + { + "__type__": "cc.Node", + "_name": "green", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 2 + }, "_children": [], "_active": true, "_components": [ { - "__id__": 3 + "__id__": 4 }, { - "__id__": 5 + "__id__": 6 }, { - "__id__": 7 + "__id__": 8 } ], "_prefab": { - "__id__": 9 + "__id__": 10 }, "_lpos": { "__type__": "cc.Vec3", @@ -140,6 +200,128 @@ }, "_id": "" }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 3 + }, + "_enabled": true, + "__prefab": { + "__id__": 5 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 170, + "height": 230 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "13G/pFKzhMuY5jDvPlPieg" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 3 + }, + "_enabled": true, + "__prefab": { + "__id__": 7 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "6165ffc9-a838-4a33-b569-bdbaaab0e6b4@c77a7", + "__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": "26mHox8cxNZKq/50xqzUAa" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 3 + }, + "_enabled": true, + "__prefab": { + "__id__": 9 + }, + "_alignFlags": 45, + "_target": null, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_horizontalCenter": 0, + "_verticalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 228, + "_originalHeight": 293, + "_alignMode": 2, + "_lockFlags": 0, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "5b6bC4fW1PtoYsU/2k2kZ7" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "70eTcKbCxCCYLLLAZxFOeW", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, { "__type__": "cc.UITransform", "_name": "", @@ -150,7 +332,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 4 + "__id__": 12 }, "_contentSize": { "__type__": "cc.Size", @@ -176,9 +358,9 @@ "node": { "__id__": 2 }, - "_enabled": true, + "_enabled": false, "__prefab": { - "__id__": 6 + "__id__": 14 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -226,7 +408,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 8 + "__id__": 16 }, "_alignFlags": 45, "_target": null, @@ -267,7 +449,7 @@ }, { "__type__": "cc.Node", - "_name": "product11", + "_name": "icon", "_objFlags": 0, "__editorExtras__": {}, "_parent": { @@ -275,26 +457,29 @@ }, "_children": [ { - "__id__": 11 + "__id__": 19 }, { - "__id__": 17 + "__id__": 27 + }, + { + "__id__": 33 } ], "_active": true, "_components": [ { - "__id__": 23 + "__id__": 39 }, { - "__id__": 25 + "__id__": 41 }, { - "__id__": 27 + "__id__": 43 } ], "_prefab": { - "__id__": 29 + "__id__": 45 }, "_lpos": { "__type__": "cc.Vec3", @@ -327,24 +512,199 @@ }, { "__type__": "cc.Node", - "_name": "function_icon_shield_magic", + "_name": "bg_green", "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 10 + "__id__": 18 }, "_children": [], "_active": true, "_components": [ { - "__id__": 12 + "__id__": 20 }, { - "__id__": 14 + "__id__": 22 + }, + { + "__id__": 24 } ], "_prefab": { - "__id__": 16 + "__id__": 26 + }, + "_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 + }, + "_mobility": 0, + "_layer": 1073741824, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 19 + }, + "_enabled": true, + "__prefab": { + "__id__": 21 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 140, + "height": 140 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "f9B/GC6ARMbrC+jKg2wLvd" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 19 + }, + "_enabled": true, + "__prefab": { + "__id__": 23 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "6165ffc9-a838-4a33-b569-bdbaaab0e6b4@49830", + "__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": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "dcQLAWPPpPRrpES1fvUQsm" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 19 + }, + "_enabled": true, + "__prefab": { + "__id__": 25 + }, + "_alignFlags": 45, + "_target": null, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_horizontalCenter": 0, + "_verticalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 200, + "_originalHeight": 216, + "_alignMode": 2, + "_lockFlags": 0, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "93Hy1a0+dN7ZTqXSNCOi4m" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "0bRuSLIuZAwb5HTI9pZjAT", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.Node", + "_name": "function_icon_shield_magic", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 18 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 28 + }, + { + "__id__": 30 + } + ], + "_prefab": { + "__id__": 32 }, "_lpos": { "__type__": "cc.Vec3", @@ -381,11 +741,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 11 + "__id__": 27 }, "_enabled": true, "__prefab": { - "__id__": 13 + "__id__": 29 }, "_contentSize": { "__type__": "cc.Size", @@ -409,11 +769,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 11 + "__id__": 27 }, "_enabled": true, "__prefab": { - "__id__": 15 + "__id__": 31 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -470,20 +830,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 10 + "__id__": 18 }, "_children": [], "_active": true, "_components": [ { - "__id__": 18 + "__id__": 34 }, { - "__id__": 20 + "__id__": 36 } ], "_prefab": { - "__id__": 22 + "__id__": 38 }, "_lpos": { "__type__": "cc.Vec3", @@ -500,8 +860,8 @@ }, "_lscale": { "__type__": "cc.Vec3", - "x": 0.5, - "y": 0.5, + "x": 1, + "y": 1, "z": 1 }, "_mobility": 0, @@ -520,11 +880,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 17 + "__id__": 33 }, "_enabled": true, "__prefab": { - "__id__": 19 + "__id__": 35 }, "_contentSize": { "__type__": "cc.Size", @@ -548,11 +908,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 17 + "__id__": 33 }, "_enabled": true, "__prefab": { - "__id__": 21 + "__id__": 37 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -606,11 +966,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 10 + "__id__": 18 }, "_enabled": true, "__prefab": { - "__id__": 24 + "__id__": 40 }, "_contentSize": { "__type__": "cc.Size", @@ -634,11 +994,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 10 + "__id__": 18 }, - "_enabled": true, + "_enabled": false, "__prefab": { - "__id__": 26 + "__id__": 42 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -679,11 +1039,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 10 + "__id__": 18 }, "_enabled": true, "__prefab": { - "__id__": 28 + "__id__": 44 }, "_alignFlags": 41, "_target": null, @@ -729,14 +1089,14 @@ "__id__": 1 }, "_prefab": { - "__id__": 31 + "__id__": 47 }, "__editorExtras__": {} }, { "__type__": "cc.PrefabInfo", "root": { - "__id__": 30 + "__id__": 46 }, "asset": { "__uuid__": "d19cde30-f5d0-47de-a0d5-3a272b696343", @@ -744,7 +1104,7 @@ }, "fileId": "c46/YsCPVOJYA4mWEpNYRx", "instance": { - "__id__": 32 + "__id__": 48 }, "targetOverrides": null }, @@ -757,46 +1117,22 @@ "mountedChildren": [], "mountedComponents": [ { - "__id__": 33 + "__id__": 49 } ], "propertyOverrides": [ { - "__id__": 37 + "__id__": 53 }, { - "__id__": 39 - }, - { - "__id__": 40 - }, - { - "__id__": 41 - }, - { - "__id__": 42 - }, - { - "__id__": 44 - }, - { - "__id__": 46 - }, - { - "__id__": 48 - }, - { - "__id__": 50 - }, - { - "__id__": 52 - }, - { - "__id__": 54 + "__id__": 55 }, { "__id__": 56 }, + { + "__id__": 57 + }, { "__id__": 58 }, @@ -804,32 +1140,23 @@ "__id__": 60 }, { - "__id__": 61 + "__id__": 62 }, { - "__id__": 63 + "__id__": 64 }, { - "__id__": 65 + "__id__": 66 }, { - "__id__": 67 - }, - { - "__id__": 69 + "__id__": 68 }, { "__id__": 70 }, - { - "__id__": 71 - }, { "__id__": 72 }, - { - "__id__": 73 - }, { "__id__": 74 }, @@ -837,22 +1164,55 @@ "__id__": 76 }, { - "__id__": 78 + "__id__": 77 }, { - "__id__": 80 + "__id__": 79 }, { "__id__": 81 }, - { - "__id__": 82 - }, { "__id__": 83 }, { - "__id__": 84 + "__id__": 85 + }, + { + "__id__": 86 + }, + { + "__id__": 87 + }, + { + "__id__": 88 + }, + { + "__id__": 89 + }, + { + "__id__": 90 + }, + { + "__id__": 92 + }, + { + "__id__": 94 + }, + { + "__id__": 96 + }, + { + "__id__": 97 + }, + { + "__id__": 98 + }, + { + "__id__": 99 + }, + { + "__id__": 100 } ], "removedComponents": [] @@ -860,11 +1220,11 @@ { "__type__": "cc.MountedComponentsInfo", "targetInfo": { - "__id__": 34 + "__id__": 50 }, "components": [ { - "__id__": 35 + "__id__": 51 } ] }, @@ -880,15 +1240,15 @@ "_objFlags": 0, "__editorExtras__": { "mountedRoot": { - "__id__": 30 + "__id__": 46 } }, "node": { - "__id__": 30 + "__id__": 46 }, "_enabled": true, "__prefab": { - "__id__": 36 + "__id__": 52 }, "_alignFlags": 41, "_target": null, @@ -917,7 +1277,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 38 + "__id__": 54 }, "propertyPath": [ "_name" @@ -933,7 +1293,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 38 + "__id__": 54 }, "propertyPath": [ "_lpos" @@ -948,7 +1308,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 38 + "__id__": 54 }, "propertyPath": [ "_lrot" @@ -964,7 +1324,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 38 + "__id__": 54 }, "propertyPath": [ "_euler" @@ -979,7 +1339,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 43 + "__id__": 59 }, "propertyPath": [ "_active" @@ -995,7 +1355,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 45 + "__id__": 61 }, "propertyPath": [ "_enabled" @@ -1011,7 +1371,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 47 + "__id__": 63 }, "propertyPath": [ "_active" @@ -1027,7 +1387,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 49 + "__id__": 65 }, "propertyPath": [ "_contentSize" @@ -1047,7 +1407,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 51 + "__id__": 67 }, "propertyPath": [ "_contentSize" @@ -1067,7 +1427,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 53 + "__id__": 69 }, "propertyPath": [ "_contentSize" @@ -1087,7 +1447,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 55 + "__id__": 71 }, "propertyPath": [ "_contentSize" @@ -1107,7 +1467,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 57 + "__id__": 73 }, "propertyPath": [ "_contentSize" @@ -1127,7 +1487,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 59 + "__id__": 75 }, "propertyPath": [ "_contentSize" @@ -1147,7 +1507,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 47 + "__id__": 63 }, "propertyPath": [ "_lpos" @@ -1162,7 +1522,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 62 + "__id__": 78 }, "propertyPath": [ "_lpos" @@ -1183,7 +1543,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 64 + "__id__": 80 }, "propertyPath": [ "_lpos" @@ -1204,7 +1564,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 66 + "__id__": 82 }, "propertyPath": [ "_lpos" @@ -1225,7 +1585,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 68 + "__id__": 84 }, "propertyPath": [ "_lpos" @@ -1246,7 +1606,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 49 + "__id__": 65 }, "propertyPath": [ "_anchorPoint" @@ -1260,7 +1620,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 38 + "__id__": 54 }, "propertyPath": [ "_active" @@ -1270,7 +1630,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 64 + "__id__": 80 }, "propertyPath": [ "_active" @@ -1280,7 +1640,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 66 + "__id__": 82 }, "propertyPath": [ "_active" @@ -1290,7 +1650,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 68 + "__id__": 84 }, "propertyPath": [ "_active" @@ -1300,7 +1660,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 75 + "__id__": 91 }, "propertyPath": [ "_lscale" @@ -1321,7 +1681,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 77 + "__id__": 93 }, "propertyPath": [ "_type" @@ -1337,7 +1697,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 79 + "__id__": 95 }, "propertyPath": [ "_left" @@ -1353,7 +1713,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 79 + "__id__": 95 }, "propertyPath": [ "_right" @@ -1363,7 +1723,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 79 + "__id__": 95 }, "propertyPath": [ "_top" @@ -1373,7 +1733,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 79 + "__id__": 95 }, "propertyPath": [ "_bottom" @@ -1383,7 +1743,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 77 + "__id__": 93 }, "propertyPath": [ "_alphaThreshold" @@ -1393,7 +1753,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 77 + "__id__": 93 }, "propertyPath": [ "_inverted" @@ -1412,17 +1772,14 @@ "_active": true, "_components": [ { - "__id__": 86 + "__id__": 102 }, { - "__id__": 88 - }, - { - "__id__": 90 + "__id__": 104 } ], "_prefab": { - "__id__": 92 + "__id__": 106 }, "_lpos": { "__type__": "cc.Vec3", @@ -1459,15 +1816,15 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 85 + "__id__": 101 }, "_enabled": true, "__prefab": { - "__id__": 87 + "__id__": 103 }, "_contentSize": { "__type__": "cc.Size", - "width": 90, + "width": 140, "height": 40 }, "_anchorPoint": { @@ -1487,11 +1844,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 85 + "__id__": 101 }, "_enabled": true, "__prefab": { - "__id__": 89 + "__id__": 105 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1549,42 +1906,6 @@ "__type__": "cc.CompPrefabInfo", "fileId": "c1dkHIVGpGAINrWXErE6GE" }, - { - "__type__": "cc.Widget", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 85 - }, - "_enabled": true, - "__prefab": { - "__id__": 91 - }, - "_alignFlags": 17, - "_target": null, - "_left": 0, - "_right": 0, - "_top": 35.379999999999995, - "_bottom": 0, - "_horizontalCenter": 0, - "_verticalCenter": 0, - "_isAbsLeft": true, - "_isAbsRight": true, - "_isAbsTop": true, - "_isAbsBottom": true, - "_isAbsHorizontalCenter": true, - "_isAbsVerticalCenter": true, - "_originalWidth": 0, - "_originalHeight": 0, - "_alignMode": 2, - "_lockFlags": 0, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "c5bJLF9ENORaTR8+amqZzR" - }, { "__type__": "cc.PrefabInfo", "root": { @@ -1610,14 +1931,14 @@ "_active": true, "_components": [ { - "__id__": 94 + "__id__": 108 }, { - "__id__": 96 + "__id__": 110 } ], "_prefab": { - "__id__": 98 + "__id__": 112 }, "_lpos": { "__type__": "cc.Vec3", @@ -1654,11 +1975,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 93 + "__id__": 107 }, "_enabled": true, "__prefab": { - "__id__": 95 + "__id__": 109 }, "_contentSize": { "__type__": "cc.Size", @@ -1682,11 +2003,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 93 + "__id__": 107 }, "_enabled": true, "__prefab": { - "__id__": 97 + "__id__": 111 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1767,29 +2088,29 @@ }, "_children": [ { - "__id__": 100 + "__id__": 114 }, { - "__id__": 108 + "__id__": 122 }, { - "__id__": 116 + "__id__": 130 } ], - "_active": true, + "_active": false, "_components": [ { - "__id__": 162 + "__id__": 176 }, { - "__id__": 164 + "__id__": 178 }, { - "__id__": 166 + "__id__": 180 } ], "_prefab": { - "__id__": 168 + "__id__": 182 }, "_lpos": { "__type__": "cc.Vec3", @@ -1826,23 +2147,23 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 99 + "__id__": 113 }, "_children": [], "_active": true, "_components": [ { - "__id__": 101 + "__id__": 115 }, { - "__id__": 103 + "__id__": 117 }, { - "__id__": 105 + "__id__": 119 } ], "_prefab": { - "__id__": 107 + "__id__": 121 }, "_lpos": { "__type__": "cc.Vec3", @@ -1879,11 +2200,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 100 + "__id__": 114 }, "_enabled": true, "__prefab": { - "__id__": 102 + "__id__": 116 }, "_contentSize": { "__type__": "cc.Size", @@ -1907,11 +2228,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 100 + "__id__": 114 }, "_enabled": true, "__prefab": { - "__id__": 104 + "__id__": 118 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1952,11 +2273,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 100 + "__id__": 114 }, "_enabled": true, "__prefab": { - "__id__": 106 + "__id__": 120 }, "_alignFlags": 45, "_target": null, @@ -2001,23 +2322,23 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 99 + "__id__": 113 }, "_children": [], "_active": true, "_components": [ { - "__id__": 109 + "__id__": 123 }, { - "__id__": 111 + "__id__": 125 }, { - "__id__": 113 + "__id__": 127 } ], "_prefab": { - "__id__": 115 + "__id__": 129 }, "_lpos": { "__type__": "cc.Vec3", @@ -2054,11 +2375,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 108 + "__id__": 122 }, "_enabled": true, "__prefab": { - "__id__": 110 + "__id__": 124 }, "_contentSize": { "__type__": "cc.Size", @@ -2082,11 +2403,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 108 + "__id__": 122 }, "_enabled": true, "__prefab": { - "__id__": 112 + "__id__": 126 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2130,11 +2451,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 108 + "__id__": 122 }, "_enabled": true, "__prefab": { - "__id__": 114 + "__id__": 128 }, "_alignFlags": 5, "_target": null, @@ -2179,36 +2500,36 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 99 + "__id__": 113 }, "_children": [ { - "__id__": 117 + "__id__": 131 }, { - "__id__": 125 + "__id__": 139 }, { - "__id__": 133 + "__id__": 147 }, { - "__id__": 141 + "__id__": 155 }, { - "__id__": 149 + "__id__": 163 } ], "_active": true, "_components": [ { - "__id__": 157 + "__id__": 171 }, { - "__id__": 159 + "__id__": 173 } ], "_prefab": { - "__id__": 161 + "__id__": 175 }, "_lpos": { "__type__": "cc.Vec3", @@ -2245,23 +2566,23 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 116 + "__id__": 130 }, "_children": [], "_active": true, "_components": [ { - "__id__": 118 + "__id__": 132 }, { - "__id__": 120 + "__id__": 134 }, { - "__id__": 122 + "__id__": 136 } ], "_prefab": { - "__id__": 124 + "__id__": 138 }, "_lpos": { "__type__": "cc.Vec3", @@ -2298,11 +2619,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 117 + "__id__": 131 }, "_enabled": true, "__prefab": { - "__id__": 119 + "__id__": 133 }, "_contentSize": { "__type__": "cc.Size", @@ -2326,11 +2647,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 117 + "__id__": 131 }, "_enabled": true, "__prefab": { - "__id__": 121 + "__id__": 135 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2371,11 +2692,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 117 + "__id__": 131 }, "_enabled": false, "__prefab": { - "__id__": 123 + "__id__": 137 }, "_alignFlags": 45, "_target": null, @@ -2420,23 +2741,23 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 116 + "__id__": 130 }, "_children": [], "_active": true, "_components": [ { - "__id__": 126 + "__id__": 140 }, { - "__id__": 128 + "__id__": 142 }, { - "__id__": 130 + "__id__": 144 } ], "_prefab": { - "__id__": 132 + "__id__": 146 }, "_lpos": { "__type__": "cc.Vec3", @@ -2473,11 +2794,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 125 + "__id__": 139 }, "_enabled": true, "__prefab": { - "__id__": 127 + "__id__": 141 }, "_contentSize": { "__type__": "cc.Size", @@ -2501,11 +2822,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 125 + "__id__": 139 }, "_enabled": true, "__prefab": { - "__id__": 129 + "__id__": 143 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2546,11 +2867,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 125 + "__id__": 139 }, "_enabled": false, "__prefab": { - "__id__": 131 + "__id__": 145 }, "_alignFlags": 45, "_target": null, @@ -2595,23 +2916,23 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 116 + "__id__": 130 }, "_children": [], "_active": true, "_components": [ { - "__id__": 134 + "__id__": 148 }, { - "__id__": 136 + "__id__": 150 }, { - "__id__": 138 + "__id__": 152 } ], "_prefab": { - "__id__": 140 + "__id__": 154 }, "_lpos": { "__type__": "cc.Vec3", @@ -2648,11 +2969,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 133 + "__id__": 147 }, "_enabled": true, "__prefab": { - "__id__": 135 + "__id__": 149 }, "_contentSize": { "__type__": "cc.Size", @@ -2676,11 +2997,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 133 + "__id__": 147 }, "_enabled": true, "__prefab": { - "__id__": 137 + "__id__": 151 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2721,11 +3042,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 133 + "__id__": 147 }, "_enabled": false, "__prefab": { - "__id__": 139 + "__id__": 153 }, "_alignFlags": 45, "_target": null, @@ -2770,23 +3091,23 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 116 + "__id__": 130 }, "_children": [], "_active": true, "_components": [ { - "__id__": 142 + "__id__": 156 }, { - "__id__": 144 + "__id__": 158 }, { - "__id__": 146 + "__id__": 160 } ], "_prefab": { - "__id__": 148 + "__id__": 162 }, "_lpos": { "__type__": "cc.Vec3", @@ -2823,11 +3144,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 141 + "__id__": 155 }, "_enabled": true, "__prefab": { - "__id__": 143 + "__id__": 157 }, "_contentSize": { "__type__": "cc.Size", @@ -2851,11 +3172,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 141 + "__id__": 155 }, "_enabled": true, "__prefab": { - "__id__": 145 + "__id__": 159 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2896,11 +3217,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 141 + "__id__": 155 }, "_enabled": false, "__prefab": { - "__id__": 147 + "__id__": 161 }, "_alignFlags": 45, "_target": null, @@ -2945,23 +3266,23 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 116 + "__id__": 130 }, "_children": [], "_active": true, "_components": [ { - "__id__": 150 + "__id__": 164 }, { - "__id__": 152 + "__id__": 166 }, { - "__id__": 154 + "__id__": 168 } ], "_prefab": { - "__id__": 156 + "__id__": 170 }, "_lpos": { "__type__": "cc.Vec3", @@ -2998,11 +3319,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 149 + "__id__": 163 }, "_enabled": true, "__prefab": { - "__id__": 151 + "__id__": 165 }, "_contentSize": { "__type__": "cc.Size", @@ -3026,11 +3347,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 149 + "__id__": 163 }, "_enabled": true, "__prefab": { - "__id__": 153 + "__id__": 167 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -3071,11 +3392,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 149 + "__id__": 163 }, "_enabled": false, "__prefab": { - "__id__": 155 + "__id__": 169 }, "_alignFlags": 45, "_target": null, @@ -3120,11 +3441,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 116 + "__id__": 130 }, "_enabled": true, "__prefab": { - "__id__": 158 + "__id__": 172 }, "_contentSize": { "__type__": "cc.Size", @@ -3148,11 +3469,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 116 + "__id__": 130 }, "_enabled": true, "__prefab": { - "__id__": 160 + "__id__": 174 }, "_resizeMode": 0, "_layoutType": 1, @@ -3189,6 +3510,8 @@ "__id__": 0 }, "fileId": "1cN0e9hbxJcIuWVokxTPom", + "instance": null, + "targetOverrides": null, "nestedPrefabInstanceRoots": null }, { @@ -3197,11 +3520,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 99 + "__id__": 113 }, "_enabled": true, "__prefab": { - "__id__": 163 + "__id__": 177 }, "_contentSize": { "__type__": "cc.Size", @@ -3225,11 +3548,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 99 + "__id__": 113 }, "_enabled": false, "__prefab": { - "__id__": 165 + "__id__": 179 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -3273,14 +3596,14 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 99 + "__id__": 113 }, "_enabled": true, "__prefab": { - "__id__": 167 + "__id__": 181 }, "_barSprite": { - "__id__": 111 + "__id__": 125 }, "_mode": 0, "_totalLength": 100, @@ -3317,14 +3640,14 @@ "_active": true, "_components": [ { - "__id__": 170 + "__id__": 184 }, { - "__id__": 172 + "__id__": 186 } ], "_prefab": { - "__id__": 174 + "__id__": 188 }, "_lpos": { "__type__": "cc.Vec3", @@ -3361,11 +3684,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 169 + "__id__": 183 }, "_enabled": true, "__prefab": { - "__id__": 171 + "__id__": 185 }, "_contentSize": { "__type__": "cc.Size", @@ -3389,11 +3712,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 169 + "__id__": 183 }, "_enabled": true, "__prefab": { - "__id__": 173 + "__id__": 187 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -3474,30 +3797,27 @@ }, "_children": [ { - "__id__": 176 - }, - { - "__id__": 182 + "__id__": 190 } ], "_active": true, "_components": [ { - "__id__": 188 + "__id__": 196 }, { - "__id__": 190 + "__id__": 198 }, { - "__id__": 192 + "__id__": 200 } ], "_prefab": { - "__id__": 194 + "__id__": 202 }, "_lpos": { "__type__": "cc.Vec3", - "x": 0, + "x": 4.963, "y": -89.584, "z": 0 }, @@ -3530,20 +3850,20 @@ "_objFlags": 512, "__editorExtras__": {}, "_parent": { - "__id__": 175 + "__id__": 189 }, "_children": [], "_active": false, "_components": [ { - "__id__": 177 + "__id__": 191 }, { - "__id__": 179 + "__id__": 193 } ], "_prefab": { - "__id__": 181 + "__id__": 195 }, "_lpos": { "__type__": "cc.Vec3", @@ -3580,11 +3900,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 176 + "__id__": 190 }, "_enabled": true, "__prefab": { - "__id__": 178 + "__id__": 192 }, "_contentSize": { "__type__": "cc.Size", @@ -3608,11 +3928,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 176 + "__id__": 190 }, "_enabled": true, "__prefab": { - "__id__": 180 + "__id__": 194 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -3683,154 +4003,18 @@ "targetOverrides": null, "nestedPrefabInstanceRoots": null }, - { - "__type__": "cc.Node", - "_name": "ItemIcon_Coin_Gold", - "_objFlags": 0, - "__editorExtras__": {}, - "_parent": { - "__id__": 175 - }, - "_children": [], - "_active": true, - "_components": [ - { - "__id__": 183 - }, - { - "__id__": 185 - } - ], - "_prefab": { - "__id__": 187 - }, - "_lpos": { - "__type__": "cc.Vec3", - "x": -32.09, - "y": 0, - "z": 0 - }, - "_lrot": { - "__type__": "cc.Quat", - "x": 0, - "y": 0, - "z": 0, - "w": 1 - }, - "_lscale": { - "__type__": "cc.Vec3", - "x": 0.3, - "y": 0.3, - "z": 1 - }, - "_mobility": 0, - "_layer": 1073741824, - "_euler": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 0 - }, - "_id": "" - }, { "__type__": "cc.UITransform", "_name": "", "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 182 - }, - "_enabled": true, - "__prefab": { - "__id__": 184 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 112, - "height": 116 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0.5 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "9fUON6NopHsJNzPVhQmJnv" - }, - { - "__type__": "cc.Sprite", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 182 - }, - "_enabled": true, - "__prefab": { - "__id__": 186 - }, - "_customMaterial": null, - "_srcBlendFactor": 2, - "_dstBlendFactor": 4, - "_color": { - "__type__": "cc.Color", - "r": 255, - "g": 255, - "b": 255, - "a": 255 - }, - "_spriteFrame": { - "__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73@23e64", - "__expectedType__": "cc.SpriteFrame" - }, - "_type": 0, - "_fillType": 0, - "_sizeMode": 1, - "_fillCenter": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_fillStart": 0, - "_fillRange": 0, - "_isTrimmedMode": true, - "_useGrayscale": false, - "_atlas": null, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "5fH/PlBvxO2rEZ5p7JN2F7" - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 1 - }, - "asset": { - "__id__": 0 - }, - "fileId": "a0P6qDVtlOeZaMkUQW2Y4s", - "instance": null, - "targetOverrides": null, - "nestedPrefabInstanceRoots": null - }, - { - "__type__": "cc.UITransform", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 175 - }, - "_enabled": true, - "__prefab": { "__id__": 189 }, + "_enabled": true, + "__prefab": { + "__id__": 197 + }, "_contentSize": { "__type__": "cc.Size", "width": 100, @@ -3853,11 +4037,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 175 + "__id__": 189 }, "_enabled": false, "__prefab": { - "__id__": 191 + "__id__": 199 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -3901,11 +4085,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 175 + "__id__": 189 }, "_enabled": true, "__prefab": { - "__id__": 193 + "__id__": 201 }, "clickEvents": [], "_interactable": true, @@ -3957,7 +4141,7 @@ "_duration": 0.1, "_zoomScale": 1.2, "_target": { - "__id__": 175 + "__id__": 189 }, "_id": "" }, @@ -3986,22 +4170,26 @@ "_parent": { "__id__": 1 }, - "_children": [], + "_children": [ + { + "__id__": 204 + } + ], "_active": true, "_components": [ { - "__id__": 196 + "__id__": 212 }, { - "__id__": 198 + "__id__": 214 } ], "_prefab": { - "__id__": 200 + "__id__": 216 }, "_lpos": { "__type__": "cc.Vec3", - "x": -10.189, + "x": 0, "y": -87.729, "z": 0 }, @@ -4028,26 +4216,201 @@ }, "_id": "" }, + { + "__type__": "cc.Node", + "_name": "ItemIcon_Coin_Gold", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 203 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 205 + }, + { + "__id__": 207 + }, + { + "__id__": 209 + } + ], + "_prefab": { + "__id__": 211 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": -39.313046875, + "y": -1.855, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 0.3, + "y": 0.3, + "z": 1 + }, + "_mobility": 0, + "_layer": 1073741824, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "" + }, { "__type__": "cc.UITransform", "_name": "", "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 195 + "__id__": 204 }, "_enabled": true, "__prefab": { - "__id__": 197 + "__id__": 206 }, "_contentSize": { "__type__": "cc.Size", - "width": 100, + "width": 112, + "height": 116 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "9fUON6NopHsJNzPVhQmJnv" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 204 + }, + "_enabled": true, + "__prefab": { + "__id__": 208 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73@23e64", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 0, + "_fillType": 0, + "_sizeMode": 1, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "5fH/PlBvxO2rEZ5p7JN2F7" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 204 + }, + "_enabled": true, + "__prefab": { + "__id__": 210 + }, + "_alignFlags": 8, + "_target": null, + "_left": -37.428476562499995, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_horizontalCenter": 0, + "_verticalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 0, + "_originalHeight": 0, + "_alignMode": 2, + "_lockFlags": 0, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "d8rEBvf5pDhq7Qf9/0Mj8s" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "a0P6qDVtlOeZaMkUQW2Y4s", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 203 + }, + "_enabled": true, + "__prefab": { + "__id__": 213 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 37.369140625, "height": 54.4 }, "_anchorPoint": { "__type__": "cc.Vec2", - "x": 0, + "x": 0.5, "y": 0.5 }, "_id": "" @@ -4062,11 +4425,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 195 + "__id__": 203 }, "_enabled": true, "__prefab": { - "__id__": 199 + "__id__": 215 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -4078,20 +4441,20 @@ "b": 255, "a": 255 }, - "_string": "50/100", - "_horizontalAlign": 0, + "_string": "10", + "_horizontalAlign": 1, "_verticalAlign": 1, - "_actualFontSize": 21, - "_fontSize": 20, + "_actualFontSize": 30, + "_fontSize": 30, "_fontFamily": "Arial", "_lineHeight": 40, - "_overflow": 2, + "_overflow": 0, "_enableWrapText": true, "_font": null, "_isSystemFontUsed": true, "_spacingX": 0, "_isItalic": false, - "_isBold": false, + "_isBold": true, "_isUnderline": false, "_underlineHeight": 2, "_cacheMode": 0, @@ -4147,7 +4510,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 202 + "__id__": 218 }, "_contentSize": { "__type__": "cc.Size", @@ -4175,7 +4538,7 @@ }, "_enabled": false, "__prefab": { - "__id__": 204 + "__id__": 220 }, "_alignFlags": 40, "_target": null, @@ -4201,6 +4564,48 @@ "__type__": "cc.CompPrefabInfo", "fileId": "87/dUplZ5PAJ7HGdPOhbyo" }, + { + "__type__": "fa67f14ml5KV7inUEdaXtlj", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 1 + }, + "_enabled": true, + "__prefab": { + "__id__": 222 + }, + "lbl_name": { + "__id__": 104 + }, + "icon_node": { + "__id__": 33 + }, + "lbl_desc": { + "__id__": 110 + }, + "lbl_level": { + "__id__": 186 + }, + "lbl_cost": { + "__id__": 214 + }, + "btn_upgrade": { + "__id__": 200 + }, + "item_bg": { + "__id__": 2 + }, + "icon_bg": { + "__id__": 18 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "7fzNohlr1GyYWpj56z+uTl" + }, { "__type__": "cc.PrefabInfo", "root": { @@ -4213,37 +4618,37 @@ "instance": null, "targetOverrides": [ { - "__id__": 206 + "__id__": 224 }, { - "__id__": 209 + "__id__": 227 }, { - "__id__": 212 + "__id__": 230 } ], "nestedPrefabInstanceRoots": [ { - "__id__": 30 + "__id__": 46 } ] }, { "__type__": "cc.TargetOverrideInfo", "source": { - "__id__": 30 + "__id__": 46 }, "sourceInfo": { - "__id__": 207 + "__id__": 225 }, "propertyPath": [ "icon_node" ], "target": { - "__id__": 30 + "__id__": 46 }, "targetInfo": { - "__id__": 208 + "__id__": 226 } }, { @@ -4261,19 +4666,19 @@ { "__type__": "cc.TargetOverrideInfo", "source": { - "__id__": 30 + "__id__": 46 }, "sourceInfo": { - "__id__": 210 + "__id__": 228 }, "propertyPath": [ "info_label" ], "target": { - "__id__": 30 + "__id__": 46 }, "targetInfo": { - "__id__": 211 + "__id__": 229 } }, { @@ -4291,15 +4696,15 @@ { "__type__": "cc.TargetOverrideInfo", "source": { - "__id__": 35 + "__id__": 51 }, "sourceInfo": null, "propertyPath": [], "target": { - "__id__": 30 + "__id__": 46 }, "targetInfo": { - "__id__": 213 + "__id__": 231 } }, { diff --git a/assets/script/game/common/config/TalentSet.ts b/assets/script/game/common/config/TalentSet.ts index dc33ffda..e97e9117 100644 --- a/assets/script/game/common/config/TalentSet.ts +++ b/assets/script/game/common/config/TalentSet.ts @@ -44,27 +44,27 @@ export const TalentConfig = { // 所有天赋定义(使用数组维护) talents: [ - { id: TalentType.Attack, name: "攻击", icon: "⚔️", desc: "+{value}%", + { id: TalentType.Attack, name: "攻击", icon: "1006", desc: "+{value}%", maxLevel: 5, values: [3, 6, 9, 12, 15], costs: [1, 1, 2, 2, 3] }, - { id: TalentType.Hp, name: "生命", icon: "❤️", desc: "+{value}%", + { id: TalentType.Hp, name: "生命", icon: "1006", desc: "+{value}%", maxLevel: 5, values: [5, 10, 15, 20, 25], costs: [1, 1, 2, 2, 3] }, - { id: TalentType.Critical, name: "暴击率", icon: "🔥", desc: "+{value}%", + { id: TalentType.Critical, name: "暴击率", icon: "1006", desc: "+{value}%", maxLevel: 5, values: [2, 4, 6, 8, 10], costs: [1, 1, 2, 2, 3] }, - { id: TalentType.WindFury, name: "风怒率", icon: "⚡", desc: "+{value}%", + { id: TalentType.WindFury, name: "风怒率", icon: "1006", desc: "+{value}%", maxLevel: 5, values: [2, 4, 6, 8, 10], costs: [1, 1, 2, 2, 3] }, - { id: TalentType.Freeze, name: "冰冻率", icon: "❄️", desc: "+{value}%", + { id: TalentType.Freeze, name: "冰冻率", icon: "1006", desc: "+{value}%", maxLevel: 5, values: [2, 4, 6, 8, 10], costs: [1, 1, 2, 2, 3] }, - { id: TalentType.Puncture, name: "穿刺", icon: "🗡️", desc: "+{value}", + { id: TalentType.Puncture, name: "穿刺", icon: "1006", desc: "+{value}", maxLevel: 5, values: [0.2, 0.4, 0.6, 0.8, 1.0], costs: [1, 1, 2, 2, 3] }, - { id: TalentType.DeadTrigger, name: "亡语额外触发", icon: "🛡️", desc: "+{value}次", + { id: TalentType.DeadTrigger, name: "亡语额外触发", icon: "1006", desc: "+{value}次", maxLevel: 1, values: [1], costs: [25] }, - { id: TalentType.Summon, name: "召唤额外触发", icon: "🛡️", desc: "+{value}次", + { id: TalentType.Summon, name: "召唤额外触发", icon: "1006", desc: "+{value}次", maxLevel: 1, values: [1], costs: [25] }, - { id: TalentType.BuyDiscount, name: "购买优惠", icon: "🛒", desc: "-{value}金币", + { id: TalentType.BuyDiscount, name: "购买优惠", icon: "1006", desc: "-{value}金币", maxLevel: 1, values: [1], costs: [10] }, - { id: TalentType.RefreshDiscount, name: "刷新优惠", icon: "🔄", desc: "-{value}金币", + { id: TalentType.RefreshDiscount, name: "刷新优惠", icon: "1006", desc: "-{value}金币", maxLevel: 1, values: [1], costs: [10] }, - { id: TalentType.SellBonus, name: "出售返还", icon: "💰", desc: "+{value}金币", + { id: TalentType.SellBonus, name: "出售返还", icon: "1006", desc: "+{value}金币", maxLevel: 1, values: [1], costs: [10] } ] as TalentInfo[] }; diff --git a/assets/script/game/map/TalentItemComp.ts b/assets/script/game/map/TalentItemComp.ts new file mode 100644 index 00000000..d59b570c --- /dev/null +++ b/assets/script/game/map/TalentItemComp.ts @@ -0,0 +1,115 @@ +/** + * @file TalentItemComp.ts + * @description 单个天赋项组件 + */ +import { _decorator, Node, Label, Button, resources, SpriteAtlas, Sprite } from "cc"; +import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS"; +import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp"; +import { TalentInfo, TalentType } from "../common/config/TalentSet"; +import { smc } from "../common/SingletonModuleComp"; + +const { ccclass, property } = _decorator; + +@ccclass('TalentItemComp') +@ecs.register('TalentItem', false) +export class TalentItemComp extends CCComp { + + @property({ type: Label, tooltip: "天赋名称" }) + lbl_name: Label = null!; + + @property({ type: Node, tooltip: "图标节点" }) + icon_node: Node = null!; + + @property({ type: Label, tooltip: "描述" }) + lbl_desc: Label = null!; + + @property({ type: Label, tooltip: "等级进度" }) + lbl_level: Label = null!; + + @property({ type: Label, tooltip: "升级消耗" }) + lbl_cost: Label = null!; + + @property({ type: Button, tooltip: "升级按钮" }) + btn_upgrade: Button = null!; + + @property({ type: Node, tooltip: "背景" }) + item_bg: Node = null!; + + @property({ type: Node, tooltip: "图标背景" }) + icon_bg: Node = null!; + + private _talentId: TalentType = TalentType.Attack; + private _onClickCallback: ((talentId: TalentType, currentLevel: number) => void) | null = null; + private _currentLevel: number = 0; + + protected onLoad(): void { + if (this.btn_upgrade && this.btn_upgrade.node) { + this.btn_upgrade.node.on(Button.EventType.CLICK, this.onUpgradeClicked, this); + } + } + + /** + * 更新天赋项显示 + * @param talentInfo 天赋配置数据 + * @param currentLevel 当前等级 + * @param onClickCallback 点击升级按钮的回调 + */ + public updateItem(talentInfo: TalentInfo, currentLevel: number, onClickCallback: (talentId: TalentType, currentLevel: number) => void) { + this._talentId = talentInfo.id; + this._currentLevel = currentLevel; + this._onClickCallback = onClickCallback; + + if (this.lbl_name) { + this.lbl_name.string = talentInfo.name; + } + + if (this.icon_node && talentInfo.icon) { + resources.load("gui/uicons", SpriteAtlas, (err, atlas) => { + if (err || !atlas) return; + const frame = atlas.getSpriteFrame(talentInfo.icon!); + if (frame && this.icon_node && this.icon_node.isValid) { + const sprite = this.icon_node.getComponent(Sprite) || this.icon_node.addComponent(Sprite); + sprite.spriteFrame = frame; + } + }); + } + + if (this.lbl_desc) { + let currentVal = currentLevel === 0 ? 0 : talentInfo.values[currentLevel - 1]; + this.lbl_desc.string = talentInfo.desc.replace('{value}', currentVal.toString()); + } + + if (this.lbl_level) { + this.lbl_level.string = `${currentLevel}/${talentInfo.maxLevel}`; + } + + let isMax = currentLevel >= talentInfo.maxLevel; + let cost = isMax ? 0 : (talentInfo.costs[currentLevel] ?? 0); + let canUpgrade = !isMax && smc.vmdata.gold >= cost; + + if (this.lbl_cost) { + this.lbl_cost.string = isMax ? "已满级" : `${cost}`; + } + + if (this.btn_upgrade) { + this.btn_upgrade.interactable = canUpgrade; + } + } + + private onUpgradeClicked() { + if (this._onClickCallback) { + this._onClickCallback(this._talentId, this._currentLevel); + } + } + + protected onDestroy(): void { + if (this.btn_upgrade && this.btn_upgrade.node && this.btn_upgrade.node.isValid) { + this.btn_upgrade.node.off(Button.EventType.CLICK, this.onUpgradeClicked, this); + } + } + + /** ECS 组件移除时销毁节点 */ + reset() { + this.node.destroy(); + } +} diff --git a/assets/script/game/map/TalentItemComp.ts.meta b/assets/script/game/map/TalentItemComp.ts.meta new file mode 100644 index 00000000..2b243093 --- /dev/null +++ b/assets/script/game/map/TalentItemComp.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "4.0.24", + "importer": "typescript", + "imported": true, + "uuid": "fa67fd78-9a5e-4a57-b8a7-50475a5ed963", + "files": [], + "subMetas": {}, + "userData": {} +} diff --git a/assets/script/game/map/TalentsComp.ts b/assets/script/game/map/TalentsComp.ts index 857ad22a..f42dfd11 100644 --- a/assets/script/game/map/TalentsComp.ts +++ b/assets/script/game/map/TalentsComp.ts @@ -25,6 +25,7 @@ import { mLogger } from "../common/Logger"; import { smc } from "../common/SingletonModuleComp"; import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops"; import { TalentConfig, TalentInfo, TalentType } from "../common/config/TalentSet"; +import { TalentItemComp } from "./TalentItemComp"; const { ccclass, property } = _decorator; @@ -59,7 +60,7 @@ export class TalentsComp extends CCComp { @property({ type: Node, tooltip: "天赋列表容器,用于动态添加天赋项" }) talents_content: Node = null!; - @property({ type: Prefab, tooltip: "天赋项预制体\n预制体结构要求:\n- 根节点\n - lbl_name (Label): 天赋名称\n - lbl_desc (Label): 天赋描述\n - lbl_level (Label): 当前等级\n - lbl_cost (Label): 升级消耗\n - btn_upgrade (Button): 升级按钮\n - pb_level (ProgressBar或一组节点): 等级进度展示(可选)" }) + @property({ type: Prefab, tooltip: "" }) prefab_talent_item: Prefab = null!; @property({ type: Button, tooltip: "看广告重置天赋按钮" }) @@ -143,57 +144,25 @@ export class TalentsComp extends CCComp { TalentConfig.talents.forEach(talentInfo => { let itemNode = instantiate(this.prefab_talent_item); this.talents_content.addChild(itemNode); - this.updateTalentItem(itemNode, talentInfo, collection.talents[talentInfo.id as TalentType]); + let comp = itemNode.getComponent(TalentItemComp); + if (comp) { + comp.updateItem(talentInfo, collection.talents[talentInfo.id as TalentType], this.onUpgradeClicked.bind(this)); + } }); } else { // 否则直接更新现有节点 TalentConfig.talents.forEach((talentInfo, index) => { let itemNode = this.talents_content.children[index]; if (itemNode) { - this.updateTalentItem(itemNode, talentInfo, collection.talents[talentInfo.id as TalentType]); + let comp = itemNode.getComponent(TalentItemComp); + if (comp) { + comp.updateItem(talentInfo, collection.talents[talentInfo.id as TalentType], this.onUpgradeClicked.bind(this)); + } } }); } } - /** 更新单个天赋项的显示 */ - private updateTalentItem(itemNode: Node, talentInfo: TalentInfo, currentLevel: number) { - let lblName = itemNode.getChildByName("lbl_name")?.getComponent(Label); - let lblDesc = itemNode.getChildByName("lbl_desc")?.getComponent(Label); - let lblLevel = itemNode.getChildByName("lbl_level")?.getComponent(Label); - let lblCost = itemNode.getChildByName("lbl_cost")?.getComponent(Label); - let btnUpgradeNode = itemNode.getChildByName("btn_upgrade"); - let btnUpgrade = btnUpgradeNode?.getComponent(Button); - - if (lblName) { - lblName.string = (talentInfo.icon ? `${talentInfo.icon} ` : '') + talentInfo.name; - } - - if (lblDesc) { - let currentVal = currentLevel === 0 ? 0 : talentInfo.values[currentLevel - 1]; - lblDesc.string = talentInfo.desc.replace('{value}', currentVal.toString()); - } - - if (lblLevel) lblLevel.string = `${currentLevel}/${talentInfo.maxLevel}`; - - let isMax = currentLevel >= talentInfo.maxLevel; - let cost = isMax ? 0 : (talentInfo.costs[currentLevel] ?? 0); - let canUpgrade = !isMax && smc.vmdata.gold >= cost; - - if (lblCost) { - lblCost.string = isMax ? "已满级" : `${cost}`; - } - - if (btnUpgrade) { - btnUpgrade.interactable = canUpgrade; - // 清除旧的监听,避免重复绑定 - btnUpgradeNode?.off(Button.EventType.CLICK); - btnUpgradeNode?.on(Button.EventType.CLICK, () => { - this.onUpgradeClicked(talentInfo.id, currentLevel); - }, this); - } - } - /** 点击升级按钮 */ private onUpgradeClicked(talentId: TalentType, currentLevel: number) { const collection = smc.collection;