From 8e1c81adb01be4d8e7739675ec797cc1b5d50036 Mon Sep 17 00:00:00 2001 From: pan Date: Tue, 1 Sep 2026 16:26:41 +0800 Subject: [PATCH] =?UTF-8?q?refactor(map):=20=E9=87=8D=E6=9E=84=E5=B0=8F?= =?UTF-8?q?=E6=B0=94=E6=B3=A1=E6=8F=90=E7=A4=BA=E9=80=BB=E8=BE=91=EF=BC=8C?= =?UTF-8?q?=E7=BB=9F=E4=B8=80=E7=BB=84=E4=BB=B6=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 新增SmallTipComp组件封装气泡提示动画逻辑 2. 移除TalentsComp中切换阶位的解锁提示弹窗 3. 重构HerosListComp的小提示逻辑,复用通用组件 4. 修改顶部UI的资源监听路径为钻石数据 --- assets/resources/gui/element/talents.prefab | 933 ++++++++++++++------ assets/resources/gui/element/top.prefab | 2 +- assets/script/game/map/HerosListComp.ts | 33 +- assets/script/game/map/SmallTipComp.ts | 61 ++ assets/script/game/map/TalentsComp.ts | 8 +- 5 files changed, 735 insertions(+), 302 deletions(-) create mode 100644 assets/script/game/map/SmallTipComp.ts diff --git a/assets/resources/gui/element/talents.prefab b/assets/resources/gui/element/talents.prefab index b5f95fb2..e1dba65f 100644 --- a/assets/resources/gui/element/talents.prefab +++ b/assets/resources/gui/element/talents.prefab @@ -28,29 +28,29 @@ "__id__": 65 }, { - "__id__": 168 + "__id__": 195 }, { - "__id__": 182 + "__id__": 209 }, { - "__id__": 232 + "__id__": 259 } ], "_active": true, "_components": [ { - "__id__": 240 + "__id__": 267 }, { - "__id__": 242 + "__id__": 269 }, { - "__id__": 244 + "__id__": 271 } ], "_prefab": { - "__id__": 246 + "__id__": 273 }, "_lpos": { "__type__": "cc.Vec3", @@ -1271,23 +1271,23 @@ "__id__": 66 }, { - "__id__": 95 + "__id__": 104 }, { - "__id__": 129 + "__id__": 147 } ], "_active": true, "_components": [ { - "__id__": 163 + "__id__": 190 }, { - "__id__": 165 + "__id__": 192 } ], "_prefab": { - "__id__": 167 + "__id__": 194 }, "_lpos": { "__type__": "cc.Vec3", @@ -1331,20 +1331,23 @@ "__id__": 67 }, { - "__id__": 75 + "__id__": 76 }, { - "__id__": 86 + "__id__": 84 + }, + { + "__id__": 95 } ], "_active": true, "_components": [ { - "__id__": 92 + "__id__": 101 } ], "_prefab": { - "__id__": 94 + "__id__": 103 }, "_lpos": { "__type__": "cc.Vec3", @@ -1392,10 +1395,10 @@ "__id__": 67 }, "asset": { - "__uuid__": "f42da8df-b2a0-49a4-a1ce-dcfe5e62e0c8", + "__uuid__": "86a3c4cd-71c7-4502-b713-65f0ace7912a", "__expectedType__": "cc.Prefab" }, - "fileId": "b6wCk5tlZEMqEmX5Myn34Y", + "fileId": "d3jYvT7whFS5scQFZeO5AK", "instance": { "__id__": 69 }, @@ -1403,7 +1406,7 @@ }, { "__type__": "cc.PrefabInstance", - "fileId": "5fZjo+f15AYo8Yu8mwlSkE", + "fileId": "bclc71oZVIeYUhoxDOlpjq", "prefabRootNode": { "__id__": 1 }, @@ -1421,6 +1424,9 @@ }, { "__id__": 74 + }, + { + "__id__": 75 } ], "removedComponents": [] @@ -1433,12 +1439,12 @@ "propertyPath": [ "_name" ], - "value": "tabbg" + "value": "smalltip" }, { "__type__": "cc.TargetInfo", "localID": [ - "b6wCk5tlZEMqEmX5Myn34Y" + "d3jYvT7whFS5scQFZeO5AK" ] }, { @@ -1452,7 +1458,7 @@ "value": { "__type__": "cc.Vec3", "x": 0, - "y": 0, + "y": 96.376, "z": 0 } }, @@ -1487,6 +1493,128 @@ "z": 0 } }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 71 + }, + "propertyPath": [ + "_active" + ], + "value": false + }, + { + "__type__": "cc.Node", + "_objFlags": 0, + "_parent": { + "__id__": 66 + }, + "_prefab": { + "__id__": 77 + }, + "__editorExtras__": {} + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 76 + }, + "asset": { + "__uuid__": "f42da8df-b2a0-49a4-a1ce-dcfe5e62e0c8", + "__expectedType__": "cc.Prefab" + }, + "fileId": "b6wCk5tlZEMqEmX5Myn34Y", + "instance": { + "__id__": 78 + }, + "targetOverrides": null + }, + { + "__type__": "cc.PrefabInstance", + "fileId": "5fZjo+f15AYo8Yu8mwlSkE", + "prefabRootNode": { + "__id__": 1 + }, + "mountedChildren": [], + "mountedComponents": [], + "propertyOverrides": [ + { + "__id__": 79 + }, + { + "__id__": 81 + }, + { + "__id__": 82 + }, + { + "__id__": 83 + } + ], + "removedComponents": [] + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 80 + }, + "propertyPath": [ + "_name" + ], + "value": "tabbg" + }, + { + "__type__": "cc.TargetInfo", + "localID": [ + "b6wCk5tlZEMqEmX5Myn34Y" + ] + }, + { + "__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__": "cc.Node", "_objFlags": 0, @@ -1494,14 +1622,14 @@ "__id__": 66 }, "_prefab": { - "__id__": 76 + "__id__": 85 }, "__editorExtras__": {} }, { "__type__": "cc.PrefabInfo", "root": { - "__id__": 75 + "__id__": 84 }, "asset": { "__uuid__": "f42da8df-b2a0-49a4-a1ce-dcfe5e62e0c8", @@ -1509,7 +1637,7 @@ }, "fileId": "b6wCk5tlZEMqEmX5Myn34Y", "instance": { - "__id__": 77 + "__id__": 86 }, "targetOverrides": null }, @@ -1523,22 +1651,22 @@ "mountedComponents": [], "propertyOverrides": [ { - "__id__": 78 + "__id__": 87 }, { - "__id__": 80 + "__id__": 89 }, { - "__id__": 81 + "__id__": 90 }, { - "__id__": 82 + "__id__": 91 }, { - "__id__": 83 + "__id__": 92 }, { - "__id__": 85 + "__id__": 94 } ], "removedComponents": [] @@ -1546,7 +1674,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 79 + "__id__": 88 }, "propertyPath": [ "_name" @@ -1562,7 +1690,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 79 + "__id__": 88 }, "propertyPath": [ "_lpos" @@ -1577,7 +1705,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 79 + "__id__": 88 }, "propertyPath": [ "_lrot" @@ -1593,7 +1721,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 79 + "__id__": 88 }, "propertyPath": [ "_euler" @@ -1608,7 +1736,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 84 + "__id__": 93 }, "propertyPath": [ "_color" @@ -1630,7 +1758,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 79 + "__id__": 88 }, "propertyPath": [ "_active" @@ -1649,14 +1777,14 @@ "_active": true, "_components": [ { - "__id__": 87 + "__id__": 96 }, { - "__id__": 89 + "__id__": 98 } ], "_prefab": { - "__id__": 91 + "__id__": 100 }, "_lpos": { "__type__": "cc.Vec3", @@ -1693,11 +1821,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 86 + "__id__": 95 }, "_enabled": true, "__prefab": { - "__id__": 88 + "__id__": 97 }, "_contentSize": { "__type__": "cc.Size", @@ -1721,11 +1849,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 86 + "__id__": 95 }, "_enabled": true, "__prefab": { - "__id__": 90 + "__id__": 99 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -1806,7 +1934,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 93 + "__id__": 102 }, "_contentSize": { "__type__": "cc.Size", @@ -1847,26 +1975,29 @@ }, "_children": [ { - "__id__": 96 - }, - { - "__id__": 104 + "__id__": 105 }, { "__id__": 114 }, { - "__id__": 120 + "__id__": 122 + }, + { + "__id__": 132 + }, + { + "__id__": 138 } ], "_active": true, "_components": [ { - "__id__": 126 + "__id__": 144 } ], "_prefab": { - "__id__": 128 + "__id__": 146 }, "_lpos": { "__type__": "cc.Vec3", @@ -1901,17 +2032,142 @@ "__type__": "cc.Node", "_objFlags": 0, "_parent": { - "__id__": 95 + "__id__": 104 }, "_prefab": { - "__id__": 97 + "__id__": 106 }, "__editorExtras__": {} }, { "__type__": "cc.PrefabInfo", "root": { - "__id__": 96 + "__id__": 105 + }, + "asset": { + "__uuid__": "86a3c4cd-71c7-4502-b713-65f0ace7912a", + "__expectedType__": "cc.Prefab" + }, + "fileId": "d3jYvT7whFS5scQFZeO5AK", + "instance": { + "__id__": 107 + }, + "targetOverrides": null + }, + { + "__type__": "cc.PrefabInstance", + "fileId": "feECgbpuFMe7KdaPCzRgXm", + "prefabRootNode": { + "__id__": 1 + }, + "mountedChildren": [], + "mountedComponents": [], + "propertyOverrides": [ + { + "__id__": 108 + }, + { + "__id__": 110 + }, + { + "__id__": 111 + }, + { + "__id__": 112 + }, + { + "__id__": 113 + } + ], + "removedComponents": [] + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 109 + }, + "propertyPath": [ + "_name" + ], + "value": "smalltip" + }, + { + "__type__": "cc.TargetInfo", + "localID": [ + "d3jYvT7whFS5scQFZeO5AK" + ] + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 109 + }, + "propertyPath": [ + "_lpos" + ], + "value": { + "__type__": "cc.Vec3", + "x": 0, + "y": 96.376, + "z": 0 + } + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 109 + }, + "propertyPath": [ + "_lrot" + ], + "value": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + } + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 109 + }, + "propertyPath": [ + "_euler" + ], + "value": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + } + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 109 + }, + "propertyPath": [ + "_active" + ], + "value": false + }, + { + "__type__": "cc.Node", + "_objFlags": 0, + "_parent": { + "__id__": 104 + }, + "_prefab": { + "__id__": 115 + }, + "__editorExtras__": {} + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 114 }, "asset": { "__uuid__": "f42da8df-b2a0-49a4-a1ce-dcfe5e62e0c8", @@ -1919,7 +2175,7 @@ }, "fileId": "b6wCk5tlZEMqEmX5Myn34Y", "instance": { - "__id__": 98 + "__id__": 116 }, "targetOverrides": null }, @@ -1933,16 +2189,16 @@ "mountedComponents": [], "propertyOverrides": [ { - "__id__": 99 + "__id__": 117 }, { - "__id__": 101 + "__id__": 119 }, { - "__id__": 102 + "__id__": 120 }, { - "__id__": 103 + "__id__": 121 } ], "removedComponents": [] @@ -1950,7 +2206,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 100 + "__id__": 118 }, "propertyPath": [ "_name" @@ -1966,7 +2222,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 100 + "__id__": 118 }, "propertyPath": [ "_lpos" @@ -1981,7 +2237,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 100 + "__id__": 118 }, "propertyPath": [ "_lrot" @@ -1997,7 +2253,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 100 + "__id__": 118 }, "propertyPath": [ "_euler" @@ -2013,17 +2269,17 @@ "__type__": "cc.Node", "_objFlags": 0, "_parent": { - "__id__": 95 + "__id__": 104 }, "_prefab": { - "__id__": 105 + "__id__": 123 }, "__editorExtras__": {} }, { "__type__": "cc.PrefabInfo", "root": { - "__id__": 104 + "__id__": 122 }, "asset": { "__uuid__": "f42da8df-b2a0-49a4-a1ce-dcfe5e62e0c8", @@ -2031,7 +2287,7 @@ }, "fileId": "b6wCk5tlZEMqEmX5Myn34Y", "instance": { - "__id__": 106 + "__id__": 124 }, "targetOverrides": null }, @@ -2045,19 +2301,19 @@ "mountedComponents": [], "propertyOverrides": [ { - "__id__": 107 + "__id__": 125 }, { - "__id__": 109 + "__id__": 127 }, { - "__id__": 110 + "__id__": 128 }, { - "__id__": 111 + "__id__": 129 }, { - "__id__": 112 + "__id__": 130 } ], "removedComponents": [] @@ -2065,7 +2321,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 108 + "__id__": 126 }, "propertyPath": [ "_name" @@ -2081,7 +2337,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 108 + "__id__": 126 }, "propertyPath": [ "_lpos" @@ -2096,7 +2352,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 108 + "__id__": 126 }, "propertyPath": [ "_lrot" @@ -2112,7 +2368,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 108 + "__id__": 126 }, "propertyPath": [ "_euler" @@ -2127,7 +2383,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 113 + "__id__": 131 }, "propertyPath": [ "_color" @@ -2152,20 +2408,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 95 + "__id__": 104 }, "_children": [], "_active": true, "_components": [ { - "__id__": 115 + "__id__": 133 }, { - "__id__": 117 + "__id__": 135 } ], "_prefab": { - "__id__": 119 + "__id__": 137 }, "_lpos": { "__type__": "cc.Vec3", @@ -2202,11 +2458,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 114 + "__id__": 132 }, "_enabled": true, "__prefab": { - "__id__": 116 + "__id__": 134 }, "_contentSize": { "__type__": "cc.Size", @@ -2230,11 +2486,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 114 + "__id__": 132 }, "_enabled": true, "__prefab": { - "__id__": 118 + "__id__": 136 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2311,20 +2567,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 95 + "__id__": 104 }, "_children": [], "_active": true, "_components": [ { - "__id__": 121 + "__id__": 139 }, { - "__id__": 123 + "__id__": 141 } ], "_prefab": { - "__id__": 125 + "__id__": 143 }, "_lpos": { "__type__": "cc.Vec3", @@ -2361,11 +2617,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 120 + "__id__": 138 }, "_enabled": true, "__prefab": { - "__id__": 122 + "__id__": 140 }, "_contentSize": { "__type__": "cc.Size", @@ -2389,11 +2645,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 120 + "__id__": 138 }, "_enabled": true, "__prefab": { - "__id__": 124 + "__id__": 142 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2444,11 +2700,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 95 + "__id__": 104 }, "_enabled": true, "__prefab": { - "__id__": 127 + "__id__": 145 }, "_contentSize": { "__type__": "cc.Size", @@ -2488,27 +2744,30 @@ "__id__": 65 }, "_children": [ - { - "__id__": 130 - }, - { - "__id__": 138 - }, { "__id__": 148 }, { - "__id__": 154 + "__id__": 157 + }, + { + "__id__": 165 + }, + { + "__id__": 175 + }, + { + "__id__": 181 } ], "_active": true, "_components": [ { - "__id__": 160 + "__id__": 187 } ], "_prefab": { - "__id__": 162 + "__id__": 189 }, "_lpos": { "__type__": "cc.Vec3", @@ -2543,17 +2802,142 @@ "__type__": "cc.Node", "_objFlags": 0, "_parent": { - "__id__": 129 + "__id__": 147 }, "_prefab": { - "__id__": 131 + "__id__": 149 }, "__editorExtras__": {} }, { "__type__": "cc.PrefabInfo", "root": { - "__id__": 130 + "__id__": 148 + }, + "asset": { + "__uuid__": "86a3c4cd-71c7-4502-b713-65f0ace7912a", + "__expectedType__": "cc.Prefab" + }, + "fileId": "d3jYvT7whFS5scQFZeO5AK", + "instance": { + "__id__": 150 + }, + "targetOverrides": null + }, + { + "__type__": "cc.PrefabInstance", + "fileId": "21DqudPGpDuaxYGQmBcnOp", + "prefabRootNode": { + "__id__": 1 + }, + "mountedChildren": [], + "mountedComponents": [], + "propertyOverrides": [ + { + "__id__": 151 + }, + { + "__id__": 153 + }, + { + "__id__": 154 + }, + { + "__id__": 155 + }, + { + "__id__": 156 + } + ], + "removedComponents": [] + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 152 + }, + "propertyPath": [ + "_name" + ], + "value": "smalltip" + }, + { + "__type__": "cc.TargetInfo", + "localID": [ + "d3jYvT7whFS5scQFZeO5AK" + ] + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 152 + }, + "propertyPath": [ + "_lpos" + ], + "value": { + "__type__": "cc.Vec3", + "x": 0, + "y": 96.376, + "z": 0 + } + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 152 + }, + "propertyPath": [ + "_lrot" + ], + "value": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + } + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 152 + }, + "propertyPath": [ + "_euler" + ], + "value": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + } + }, + { + "__type__": "CCPropertyOverrideInfo", + "targetInfo": { + "__id__": 152 + }, + "propertyPath": [ + "_active" + ], + "value": false + }, + { + "__type__": "cc.Node", + "_objFlags": 0, + "_parent": { + "__id__": 147 + }, + "_prefab": { + "__id__": 158 + }, + "__editorExtras__": {} + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 157 }, "asset": { "__uuid__": "f42da8df-b2a0-49a4-a1ce-dcfe5e62e0c8", @@ -2561,7 +2945,7 @@ }, "fileId": "b6wCk5tlZEMqEmX5Myn34Y", "instance": { - "__id__": 132 + "__id__": 159 }, "targetOverrides": null }, @@ -2575,16 +2959,16 @@ "mountedComponents": [], "propertyOverrides": [ { - "__id__": 133 + "__id__": 160 }, { - "__id__": 135 + "__id__": 162 }, { - "__id__": 136 + "__id__": 163 }, { - "__id__": 137 + "__id__": 164 } ], "removedComponents": [] @@ -2592,7 +2976,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 134 + "__id__": 161 }, "propertyPath": [ "_name" @@ -2608,7 +2992,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 134 + "__id__": 161 }, "propertyPath": [ "_lpos" @@ -2623,7 +3007,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 134 + "__id__": 161 }, "propertyPath": [ "_lrot" @@ -2639,7 +3023,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 134 + "__id__": 161 }, "propertyPath": [ "_euler" @@ -2655,17 +3039,17 @@ "__type__": "cc.Node", "_objFlags": 0, "_parent": { - "__id__": 129 + "__id__": 147 }, "_prefab": { - "__id__": 139 + "__id__": 166 }, "__editorExtras__": {} }, { "__type__": "cc.PrefabInfo", "root": { - "__id__": 138 + "__id__": 165 }, "asset": { "__uuid__": "f42da8df-b2a0-49a4-a1ce-dcfe5e62e0c8", @@ -2673,7 +3057,7 @@ }, "fileId": "b6wCk5tlZEMqEmX5Myn34Y", "instance": { - "__id__": 140 + "__id__": 167 }, "targetOverrides": null }, @@ -2687,19 +3071,19 @@ "mountedComponents": [], "propertyOverrides": [ { - "__id__": 141 + "__id__": 168 }, { - "__id__": 143 + "__id__": 170 }, { - "__id__": 144 + "__id__": 171 }, { - "__id__": 145 + "__id__": 172 }, { - "__id__": 146 + "__id__": 173 } ], "removedComponents": [] @@ -2707,7 +3091,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 142 + "__id__": 169 }, "propertyPath": [ "_name" @@ -2723,7 +3107,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 142 + "__id__": 169 }, "propertyPath": [ "_lpos" @@ -2738,7 +3122,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 142 + "__id__": 169 }, "propertyPath": [ "_lrot" @@ -2754,7 +3138,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 142 + "__id__": 169 }, "propertyPath": [ "_euler" @@ -2769,7 +3153,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 147 + "__id__": 174 }, "propertyPath": [ "_color" @@ -2794,20 +3178,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 129 + "__id__": 147 }, "_children": [], "_active": true, "_components": [ { - "__id__": 149 + "__id__": 176 }, { - "__id__": 151 + "__id__": 178 } ], "_prefab": { - "__id__": 153 + "__id__": 180 }, "_lpos": { "__type__": "cc.Vec3", @@ -2844,11 +3228,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 148 + "__id__": 175 }, "_enabled": true, "__prefab": { - "__id__": 150 + "__id__": 177 }, "_contentSize": { "__type__": "cc.Size", @@ -2872,11 +3256,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 148 + "__id__": 175 }, "_enabled": true, "__prefab": { - "__id__": 152 + "__id__": 179 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2953,20 +3337,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 129 + "__id__": 147 }, "_children": [], "_active": true, "_components": [ { - "__id__": 155 + "__id__": 182 }, { - "__id__": 157 + "__id__": 184 } ], "_prefab": { - "__id__": 159 + "__id__": 186 }, "_lpos": { "__type__": "cc.Vec3", @@ -3003,11 +3387,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 154 + "__id__": 181 }, "_enabled": true, "__prefab": { - "__id__": 156 + "__id__": 183 }, "_contentSize": { "__type__": "cc.Size", @@ -3031,11 +3415,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 154 + "__id__": 181 }, "_enabled": true, "__prefab": { - "__id__": 158 + "__id__": 185 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -3086,11 +3470,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 129 + "__id__": 147 }, "_enabled": true, "__prefab": { - "__id__": 161 + "__id__": 188 }, "_contentSize": { "__type__": "cc.Size", @@ -3131,7 +3515,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 164 + "__id__": 191 }, "_contentSize": { "__type__": "cc.Size", @@ -3159,7 +3543,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 166 + "__id__": 193 }, "_resizeMode": 1, "_layoutType": 1, @@ -3210,20 +3594,20 @@ }, "_children": [ { - "__id__": 169 + "__id__": 196 } ], "_active": true, "_components": [ { - "__id__": 177 + "__id__": 204 }, { - "__id__": 179 + "__id__": 206 } ], "_prefab": { - "__id__": 181 + "__id__": 208 }, "_lpos": { "__type__": "cc.Vec3", @@ -3260,23 +3644,23 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 168 + "__id__": 195 }, "_children": [], "_active": true, "_components": [ { - "__id__": 170 + "__id__": 197 }, { - "__id__": 172 + "__id__": 199 }, { - "__id__": 174 + "__id__": 201 } ], "_prefab": { - "__id__": 176 + "__id__": 203 }, "_lpos": { "__type__": "cc.Vec3", @@ -3313,11 +3697,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 169 + "__id__": 196 }, "_enabled": true, "__prefab": { - "__id__": 171 + "__id__": 198 }, "_contentSize": { "__type__": "cc.Size", @@ -3341,11 +3725,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 169 + "__id__": 196 }, "_enabled": true, "__prefab": { - "__id__": 173 + "__id__": 200 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -3386,11 +3770,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 169 + "__id__": 196 }, "_enabled": true, "__prefab": { - "__id__": 175 + "__id__": 202 }, "_alignFlags": 45, "_target": null, @@ -3435,11 +3819,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 168 + "__id__": 195 }, "_enabled": true, "__prefab": { - "__id__": 178 + "__id__": 205 }, "_contentSize": { "__type__": "cc.Size", @@ -3463,11 +3847,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 168 + "__id__": 195 }, "_enabled": true, "__prefab": { - "__id__": 180 + "__id__": 207 }, "_alignFlags": 41, "_target": null, @@ -3516,29 +3900,29 @@ }, "_children": [ { - "__id__": 183 + "__id__": 210 }, { - "__id__": 195 + "__id__": 222 }, { - "__id__": 213 + "__id__": 240 } ], "_active": true, "_components": [ { - "__id__": 225 + "__id__": 252 }, { - "__id__": 227 + "__id__": 254 }, { - "__id__": 229 + "__id__": 256 } ], "_prefab": { - "__id__": 231 + "__id__": 258 }, "_lpos": { "__type__": "cc.Vec3", @@ -3575,24 +3959,24 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 182 + "__id__": 209 }, "_children": [ { - "__id__": 184 + "__id__": 211 } ], "_active": true, "_components": [ { - "__id__": 190 + "__id__": 217 }, { - "__id__": 192 + "__id__": 219 } ], "_prefab": { - "__id__": 194 + "__id__": 221 }, "_lpos": { "__type__": "cc.Vec3", @@ -3629,20 +4013,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 183 + "__id__": 210 }, "_children": [], "_active": true, "_components": [ { - "__id__": 185 + "__id__": 212 }, { - "__id__": 187 + "__id__": 214 } ], "_prefab": { - "__id__": 189 + "__id__": 216 }, "_lpos": { "__type__": "cc.Vec3", @@ -3679,11 +4063,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 184 + "__id__": 211 }, "_enabled": true, "__prefab": { - "__id__": 186 + "__id__": 213 }, "_contentSize": { "__type__": "cc.Size", @@ -3707,11 +4091,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 184 + "__id__": 211 }, "_enabled": true, "__prefab": { - "__id__": 188 + "__id__": 215 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -3788,11 +4172,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 183 + "__id__": 210 }, "_enabled": true, "__prefab": { - "__id__": 191 + "__id__": 218 }, "_contentSize": { "__type__": "cc.Size", @@ -3816,11 +4200,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 183 + "__id__": 210 }, "_enabled": true, "__prefab": { - "__id__": 193 + "__id__": 220 }, "_alignFlags": 32, "_target": null, @@ -3865,21 +4249,21 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 182 + "__id__": 209 }, "_children": [ { - "__id__": 196 + "__id__": 223 } ], "_active": true, "_components": [ { - "__id__": 210 + "__id__": 237 } ], "_prefab": { - "__id__": 212 + "__id__": 239 }, "_lpos": { "__type__": "cc.Vec3", @@ -3916,27 +4300,27 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 195 + "__id__": 222 }, "_children": [ { - "__id__": 197 + "__id__": 224 } ], "_active": true, "_components": [ { - "__id__": 203 + "__id__": 230 }, { - "__id__": 205 + "__id__": 232 }, { - "__id__": 207 + "__id__": 234 } ], "_prefab": { - "__id__": 209 + "__id__": 236 }, "_lpos": { "__type__": "cc.Vec3", @@ -3973,20 +4357,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 196 + "__id__": 223 }, "_children": [], "_active": true, "_components": [ { - "__id__": 198 + "__id__": 225 }, { - "__id__": 200 + "__id__": 227 } ], "_prefab": { - "__id__": 202 + "__id__": 229 }, "_lpos": { "__type__": "cc.Vec3", @@ -4023,11 +4407,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 197 + "__id__": 224 }, "_enabled": true, "__prefab": { - "__id__": 199 + "__id__": 226 }, "_contentSize": { "__type__": "cc.Size", @@ -4051,11 +4435,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 197 + "__id__": 224 }, "_enabled": true, "__prefab": { - "__id__": 201 + "__id__": 228 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -4112,11 +4496,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 196 + "__id__": 223 }, "_enabled": true, "__prefab": { - "__id__": 204 + "__id__": 231 }, "_contentSize": { "__type__": "cc.Size", @@ -4140,11 +4524,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 196 + "__id__": 223 }, "_enabled": true, "__prefab": { - "__id__": 206 + "__id__": 233 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -4188,14 +4572,14 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 196 + "__id__": 223 }, "_enabled": true, "__prefab": { - "__id__": 208 + "__id__": 235 }, "_barSprite": { - "__id__": 200 + "__id__": 227 }, "_mode": 0, "_totalLength": 800, @@ -4226,11 +4610,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 195 + "__id__": 222 }, "_enabled": true, "__prefab": { - "__id__": 211 + "__id__": 238 }, "_contentSize": { "__type__": "cc.Size", @@ -4267,24 +4651,24 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 182 + "__id__": 209 }, "_children": [ { - "__id__": 214 + "__id__": 241 } ], "_active": true, "_components": [ { - "__id__": 220 + "__id__": 247 }, { - "__id__": 222 + "__id__": 249 } ], "_prefab": { - "__id__": 224 + "__id__": 251 }, "_lpos": { "__type__": "cc.Vec3", @@ -4321,20 +4705,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 213 + "__id__": 240 }, "_children": [], "_active": true, "_components": [ { - "__id__": 215 + "__id__": 242 }, { - "__id__": 217 + "__id__": 244 } ], "_prefab": { - "__id__": 219 + "__id__": 246 }, "_lpos": { "__type__": "cc.Vec3", @@ -4371,11 +4755,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 214 + "__id__": 241 }, "_enabled": true, "__prefab": { - "__id__": 216 + "__id__": 243 }, "_contentSize": { "__type__": "cc.Size", @@ -4399,11 +4783,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 214 + "__id__": 241 }, "_enabled": true, "__prefab": { - "__id__": 218 + "__id__": 245 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -4480,11 +4864,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 213 + "__id__": 240 }, "_enabled": true, "__prefab": { - "__id__": 221 + "__id__": 248 }, "_contentSize": { "__type__": "cc.Size", @@ -4508,11 +4892,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 213 + "__id__": 240 }, "_enabled": true, "__prefab": { - "__id__": 223 + "__id__": 250 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -4569,11 +4953,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 182 + "__id__": 209 }, "_enabled": true, "__prefab": { - "__id__": 226 + "__id__": 253 }, "_contentSize": { "__type__": "cc.Size", @@ -4597,11 +4981,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 182 + "__id__": 209 }, "_enabled": false, "__prefab": { - "__id__": 228 + "__id__": 255 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -4642,11 +5026,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 182 + "__id__": 209 }, "_enabled": true, "__prefab": { - "__id__": 230 + "__id__": 257 }, "_alignFlags": 41, "_target": null, @@ -4697,17 +5081,17 @@ "_active": true, "_components": [ { - "__id__": 233 + "__id__": 260 }, { - "__id__": 235 + "__id__": 262 }, { - "__id__": 237 + "__id__": 264 } ], "_prefab": { - "__id__": 239 + "__id__": 266 }, "_lpos": { "__type__": "cc.Vec3", @@ -4744,11 +5128,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 232 + "__id__": 259 }, "_enabled": true, "__prefab": { - "__id__": 234 + "__id__": 261 }, "_contentSize": { "__type__": "cc.Size", @@ -4772,11 +5156,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 232 + "__id__": 259 }, "_enabled": true, "__prefab": { - "__id__": 236 + "__id__": 263 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -4840,11 +5224,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 232 + "__id__": 259 }, "_enabled": true, "__prefab": { - "__id__": 238 + "__id__": 265 }, "_alignFlags": 9, "_target": null, @@ -4893,7 +5277,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 241 + "__id__": 268 }, "_contentSize": { "__type__": "cc.Size", @@ -4921,7 +5305,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 243 + "__id__": 270 }, "_alignFlags": 45, "_target": null, @@ -4957,7 +5341,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 245 + "__id__": 272 }, "talents_content": { "__id__": 39 @@ -4967,31 +5351,31 @@ "__expectedType__": "cc.Prefab" }, "lbl_points": { - "__id__": 187 + "__id__": 214 }, "lbl_lv": { - "__id__": 217 + "__id__": 244 }, "progress_exp": { - "__id__": 207 + "__id__": 234 }, "tab_basic": { "__id__": 66 }, "tab_special": { - "__id__": 95 + "__id__": 104 }, "tab_super": { - "__id__": 129 + "__id__": 147 }, "lbl_tab_basic": { - "__id__": 89 + "__id__": 98 }, "lbl_tab_special": { - "__id__": 117 + "__id__": 135 }, "lbl_tab_super": { - "__id__": 151 + "__id__": 178 }, "btn_reset": null, "_id": "" @@ -5013,19 +5397,28 @@ "targetOverrides": null, "nestedPrefabInstanceRoots": [ { - "__id__": 138 + "__id__": 165 }, { - "__id__": 130 + "__id__": 157 }, { - "__id__": 104 + "__id__": 148 }, { - "__id__": 96 + "__id__": 122 }, { - "__id__": 75 + "__id__": 114 + }, + { + "__id__": 105 + }, + { + "__id__": 84 + }, + { + "__id__": 76 }, { "__id__": 67 diff --git a/assets/resources/gui/element/top.prefab b/assets/resources/gui/element/top.prefab index 9a55d905..624e1b41 100644 --- a/assets/resources/gui/element/top.prefab +++ b/assets/resources/gui/element/top.prefab @@ -1628,7 +1628,7 @@ "watchPath": "data.data.gold", "labelType": "cc.Label", "watchPathArr": [ - "data.gold" + "data.diamond" ], "_id": "" }, diff --git a/assets/script/game/map/HerosListComp.ts b/assets/script/game/map/HerosListComp.ts index 887bd059..69bc9e16 100644 --- a/assets/script/game/map/HerosListComp.ts +++ b/assets/script/game/map/HerosListComp.ts @@ -28,6 +28,7 @@ import { GameEvent } from "../common/config/GameEvent"; import { HERO_UPGRADE_NEED_FRAGMENTS, CARD_LV_BG_COLORS } from "../common/config/GameSet"; import { CardLiteComp } from "./CardLiteComp"; import { ChipComp } from "./ChipComp"; +import { SmallTipComp } from "./SmallTipComp"; import { SSkillBoxComp } from "./SSkillBoxComp"; import { smc } from "../common/SingletonModuleComp"; @@ -142,9 +143,12 @@ export class HerosListComp extends CCComp { return } - // 确保 smalltip 气泡初始隐藏,避免遮挡按钮触摸 + // 确保 smalltip 气泡初始隐藏,避免遮挡按钮触摸(组件缺失时兜底补挂) const tipNode = this.upgrade_btn.getChildByName("smalltip") - if (tipNode) tipNode.active = false + if (tipNode) { + const tip = tipNode.getComponent(SmallTipComp) ?? tipNode.addComponent(SmallTipComp) + tipNode.active = false + } let btn = this.upgrade_btn.getComponent(Button) if (!btn) btn = this.upgrade_btn.addComponent(Button) @@ -276,33 +280,14 @@ export class HerosListComp extends CCComp { * @param text 提示文案 */ private showSmallTip(text: string) { - // smalltip 作为 upgrade_btn 的子节点挂在下面 + // smalltip 作为 upgrade_btn 的子节点挂在下面,统一走 SmallTipComp 播动画 const tipNode = this.upgrade_btn?.getChildByName("smalltip") if (!tipNode || !tipNode.isValid) { mLogger.log(this.debugMode, "HerosListComp", `未在 upgrade_btn 下找到 smalltip 节点,无法提示:${text}`) return } - - // 覆盖气泡文字 - const label = tipNode.getComponentInChildren(Label) - if (label) label.string = text - - tipNode.active = true - Tween.stopAllByTarget(tipNode) - tipNode.setScale(0, 0, 1) - - tween(tipNode) - // 弹出动画(微放大再回弹) - .to(0.15, { scale: new Vec3(1.1, 1.1, 1) }, { easing: 'quadOut' }) - .to(0.05, { scale: new Vec3(1, 1, 1) }) - // 停留 1 秒 - .delay(1) - // 缩小消失 - .to(0.15, { scale: new Vec3(0, 0, 1) }, { easing: 'quadIn' }) - .call(() => { - if (tipNode && tipNode.isValid) tipNode.active = false - }) - .start() + const tip = tipNode.getComponent(SmallTipComp) ?? tipNode.addComponent(SmallTipComp) + tip.show(text) } // ======================== 卡片列表 ======================== diff --git a/assets/script/game/map/SmallTipComp.ts b/assets/script/game/map/SmallTipComp.ts new file mode 100644 index 00000000..73446f92 --- /dev/null +++ b/assets/script/game/map/SmallTipComp.ts @@ -0,0 +1,61 @@ +/** + * @file SmallTipComp.ts + * @description smalltip 气泡提示组件(UI 通用层) + * + * 职责: + * 封装 smalltip.prefab 气泡的弹出/消失动画与文案填充,供各页面复用。 + * 调用方通过 getComponent(SmallTipComp) 获取实例后调 show(text) 即可, + * 无需关心节点显隐与 Tween 生命周期。 + * + * 用法: + * 1. 编辑器侧将本组件挂在 smalltip 节点上(或运行时 addComponent 兜底)。 + * 2. 默认隐藏节点(active = false),调用 show() 自动弹出并在停留后缩小隐藏。 + */ +import { _decorator, Component, Label, Tween, Vec3, tween } from "cc"; + +const { ccclass } = _decorator; + +/** 气泡停留时长(秒) */ +const STAY_DURATION = 1; + +/** SmallTipComp —— smalltip 气泡提示(弹出 → 停留 → 缩小隐藏) */ +@ccclass('SmallTipComp') +export class SmallTipComp extends Component { + + protected onLoad(): void { + // 初始隐藏,避免遮挡挂载点的触摸事件 + this.node.active = false; + } + + /** + * 弹出气泡提示(重复调用时打断当前动画,从头播放) + * @param text 提示文案 + * @param stay 停留时长(秒),默认 1 秒 + */ + public show(text: string, stay: number = STAY_DURATION): void { + // 覆盖气泡文字 + const label = this.getComponentInChildren(Label); + if (label) label.string = text; + + this.node.active = true; + Tween.stopAllByTarget(this.node); + this.node.setScale(0, 0, 1); + + tween(this.node) + // 弹出动画(微放大再回弹) + .to(0.15, { scale: new Vec3(1.1, 1.1, 1) }, { easing: 'quadOut' }) + .to(0.05, { scale: new Vec3(1, 1, 1) }) + // 停留 + .delay(stay) + // 缩小消失 + .to(0.15, { scale: new Vec3(0, 0, 1) }, { easing: 'quadIn' }) + .call(() => { + if (this.node && this.node.isValid) this.node.active = false; + }) + .start(); + } + + protected onDestroy(): void { + Tween.stopAllByTarget(this.node); + } +} diff --git a/assets/script/game/map/TalentsComp.ts b/assets/script/game/map/TalentsComp.ts index c6a90171..28432121 100644 --- a/assets/script/game/map/TalentsComp.ts +++ b/assets/script/game/map/TalentsComp.ts @@ -123,16 +123,10 @@ export class TalentsComp extends CCComp { this.btn_reset?.targetOff(this); } - /** 切换阶位页签:锁定阶允许查看(卡片呈锁定态),并提示解锁条件 */ + /** 切换阶位页签:锁定阶允许查看(卡片呈锁定态),不弹解锁提示 */ private selectTier(tier: TalentTier): void { if (tier === this.curTier) return; this.curTier = tier; - const levels = smc.getTalentLevels(); - if (!isTalentTierUnlocked(levels, tier)) { - const prev = tier - 1; - const invested = getTalentTierInvestedPoints(levels, prev); - oops.gui.toast(`${TIER_TAB_TEXT[tier].lockName}投入 ${invested}/${TALENT_TIER_UNLOCK_THRESHOLD} 点解锁本阶`); - } this.refreshUI(); }