From e011cba0473f4c8f2e8ea33c45398350f9e8226d Mon Sep 17 00:00:00 2001 From: walkpan Date: Mon, 20 Oct 2025 23:37:38 +0800 Subject: [PATCH] =?UTF-8?q?feat(gui):=20=E4=BC=98=E5=8C=96=E8=A7=92?= =?UTF-8?q?=E8=89=B2=E7=95=8C=E9=9D=A2Prefab=E7=BB=93=E6=9E=84=E4=B8=8E?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E4=BA=A4=E4=BA=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 调整角色控制器Prefab中节点的组件ID引用 - 修正部分节点的激活状态与位置信息 - 更新按钮组件及点击事件绑定,改进英雄购买交互逻辑 - 替换文本标签组件,新增字体样式与阴影效果提升可读性 - 增加背景与装饰组件,优化界面视觉层次与布局 - 调整图片资源引用,修改部分Sprite颜色及灰度设置 - 优化UITransform组件配置,调整节点尺寸与锚点位置 - 引入新的Widget组件,完善布局自适应能力 - 增加输入事件阻断组件,防止界面误触操作 - 整体提升界面元素结构清晰度与交互体验一致性 --- assets/resources/gui/role_controller.prefab | 1042 ++++++++++++++----- assets/script/game/common/config/heroSet.ts | 9 +- assets/script/game/map/HInfoComp.ts | 26 +- assets/script/game/map/MissionHomeComp.ts | 8 +- 4 files changed, 833 insertions(+), 252 deletions(-) diff --git a/assets/resources/gui/role_controller.prefab b/assets/resources/gui/role_controller.prefab index 4a5b2093..c81dd44a 100644 --- a/assets/resources/gui/role_controller.prefab +++ b/assets/resources/gui/role_controller.prefab @@ -25,29 +25,29 @@ "__id__": 53 }, { - "__id__": 272 + "__id__": 297 }, { - "__id__": 300 + "__id__": 325 } ], "_active": true, "_components": [ { - "__id__": 346 + "__id__": 371 }, { - "__id__": 348 + "__id__": 373 }, { - "__id__": 350 + "__id__": 375 }, { - "__id__": 352 + "__id__": 377 } ], "_prefab": { - "__id__": 354 + "__id__": 379 }, "_lpos": { "__type__": "cc.Vec3", @@ -1233,29 +1233,32 @@ "__id__": 189 }, { - "__id__": 210 + "__id__": 214 }, { - "__id__": 231 + "__id__": 235 + }, + { + "__id__": 256 } ], "_active": true, "_components": [ { - "__id__": 263 + "__id__": 288 }, { - "__id__": 265 + "__id__": 290 }, { - "__id__": 267 + "__id__": 292 }, { - "__id__": 269 + "__id__": 294 } ], "_prefab": { - "__id__": 271 + "__id__": 296 }, "_lpos": { "__type__": "cc.Vec3", @@ -4314,7 +4317,7 @@ "_lpos": { "__type__": "cc.Vec3", "x": 0, - "y": -2.889, + "y": 0, "z": 0 }, "_lrot": { @@ -4545,7 +4548,7 @@ "__id__": 53 }, "component": "", - "_componentId": "11498TbVJpO6qmZ8m9k55Zx", + "_componentId": "f8dd2ODYatM+Zh5DQ/izWwv", "handler": "start_mission", "customEventData": "" }, @@ -4600,7 +4603,7 @@ }, { "__type__": "cc.Node", - "_name": "next", + "_name": "buy", "_objFlags": 0, "__editorExtras__": {}, "_parent": { @@ -4609,22 +4612,589 @@ "_children": [ { "__id__": 190 + }, + { + "__id__": 198 } ], - "_active": true, + "_active": false, "_components": [ - { - "__id__": 202 - }, { "__id__": 204 }, { "__id__": 206 + }, + { + "__id__": 209 + }, + { + "__id__": 211 } ], "_prefab": { - "__id__": 209 + "__id__": 213 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": 74.967, + "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": "bg", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 189 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 191 + }, + { + "__id__": 193 + }, + { + "__id__": 195 + } + ], + "_prefab": { + "__id__": 197 + }, + "_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__": 190 + }, + "_enabled": true, + "__prefab": { + "__id__": 192 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 200, + "height": 102 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "c5kw0hG3NIvqEh20mL/wcO" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 190 + }, + "_enabled": true, + "__prefab": { + "__id__": 194 + }, + "_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@43b3d", + "__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": { + "__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73", + "__expectedType__": "cc.SpriteAtlas" + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "2341Oi52lNSqW568iq/cm/" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 190 + }, + "_enabled": true, + "__prefab": { + "__id__": 196 + }, + "_alignFlags": 45, + "_target": null, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_horizontalCenter": 0, + "_verticalCenter": 0, + "_isAbsLeft": false, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 260, + "_originalHeight": 140, + "_alignMode": 2, + "_lockFlags": 0, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "64G7BI4ZtJHriKjI69whJV" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "14rlNOTFpO5qGtowypdxJR", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.Node", + "_name": "name", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 189 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 199 + }, + { + "__id__": 201 + } + ], + "_prefab": { + "__id__": 203 + }, + "_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.0000000000000002, + "y": 1.0000000000000002, + "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__": 198 + }, + "_enabled": true, + "__prefab": { + "__id__": 200 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 84, + "height": 54.4 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "1a7k2IXPJH9bzKvdyFGxJq" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 198 + }, + "_enabled": true, + "__prefab": { + "__id__": 202 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_string": "解锁", + "_horizontalAlign": 1, + "_verticalAlign": 1, + "_actualFontSize": 40, + "_fontSize": 40, + "_fontFamily": "Arial", + "_lineHeight": 40, + "_overflow": 0, + "_enableWrapText": true, + "_font": null, + "_isSystemFontUsed": true, + "_spacingX": 0, + "_isItalic": false, + "_isBold": true, + "_isUnderline": false, + "_underlineHeight": 2, + "_cacheMode": 0, + "_enableOutline": true, + "_outlineColor": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_outlineWidth": 2, + "_enableShadow": true, + "_shadowColor": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_shadowOffset": { + "__type__": "cc.Vec2", + "x": 2, + "y": -2 + }, + "_shadowBlur": 2, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "3d17poaYdMW7DM8oRLpQu8" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "2fdT6Dh4xN17JUK5gsP/RN", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 189 + }, + "_enabled": true, + "__prefab": { + "__id__": 205 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 200, + "height": 102 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "331M+MPu5F8peGOwsA04do" + }, + { + "__type__": "cc.Button", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 189 + }, + "_enabled": true, + "__prefab": { + "__id__": 207 + }, + "clickEvents": [ + { + "__id__": 208 + } + ], + "_interactable": true, + "_transition": 3, + "_normalColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_hoverColor": { + "__type__": "cc.Color", + "r": 211, + "g": 211, + "b": 211, + "a": 255 + }, + "_pressedColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_disabledColor": { + "__type__": "cc.Color", + "r": 124, + "g": 124, + "b": 124, + "a": 255 + }, + "_normalSprite": null, + "_hoverSprite": null, + "_pressedSprite": null, + "_disabledSprite": null, + "_duration": 0.1, + "_zoomScale": 0.8, + "_target": { + "__id__": 189 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "14ZHSnz7NNJ5//r5zBXZBf" + }, + { + "__type__": "cc.ClickEvent", + "target": { + "__id__": 53 + }, + "component": "", + "_componentId": "f8dd2ODYatM+Zh5DQ/izWwv", + "handler": "buy_hero", + "customEventData": "" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 189 + }, + "_enabled": true, + "__prefab": { + "__id__": 210 + }, + "_alignFlags": 4, + "_target": null, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 23.967, + "_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": "f85VMRjAdIPKdT7ZqNGFqa" + }, + { + "__type__": "cc.BlockInputEvents", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 189 + }, + "_enabled": true, + "__prefab": { + "__id__": 212 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "f4q2jmfLpBzrVh6TEHPxAh" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "372/A0SMFFD7zHZH2s7Car", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.Node", + "_name": "next", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 53 + }, + "_children": [ + { + "__id__": 215 + } + ], + "_active": true, + "_components": [ + { + "__id__": 227 + }, + { + "__id__": 229 + }, + { + "__id__": 231 + } + ], + "_prefab": { + "__id__": 234 }, "_lpos": { "__type__": "cc.Vec3", @@ -4661,24 +5231,24 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 189 + "__id__": 214 }, "_children": [ { - "__id__": 191 + "__id__": 216 } ], "_active": true, "_components": [ { - "__id__": 197 + "__id__": 222 }, { - "__id__": 199 + "__id__": 224 } ], "_prefab": { - "__id__": 201 + "__id__": 226 }, "_lpos": { "__type__": "cc.Vec3", @@ -4715,20 +5285,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 190 + "__id__": 215 }, "_children": [], "_active": true, "_components": [ { - "__id__": 192 + "__id__": 217 }, { - "__id__": 194 + "__id__": 219 } ], "_prefab": { - "__id__": 196 + "__id__": 221 }, "_lpos": { "__type__": "cc.Vec3", @@ -4765,11 +5335,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 191 + "__id__": 216 }, "_enabled": true, "__prefab": { - "__id__": 193 + "__id__": 218 }, "_contentSize": { "__type__": "cc.Size", @@ -4793,11 +5363,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 191 + "__id__": 216 }, "_enabled": true, "__prefab": { - "__id__": 195 + "__id__": 220 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -4854,11 +5424,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 190 + "__id__": 215 }, "_enabled": true, "__prefab": { - "__id__": 198 + "__id__": 223 }, "_contentSize": { "__type__": "cc.Size", @@ -4882,11 +5452,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 190 + "__id__": 215 }, "_enabled": true, "__prefab": { - "__id__": 200 + "__id__": 225 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -4943,11 +5513,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 189 + "__id__": 214 }, "_enabled": true, "__prefab": { - "__id__": 203 + "__id__": 228 }, "_contentSize": { "__type__": "cc.Size", @@ -4971,11 +5541,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 189 + "__id__": 214 }, "_enabled": true, "__prefab": { - "__id__": 205 + "__id__": 230 }, "_alignFlags": 4, "_target": null, @@ -5007,15 +5577,15 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 189 + "__id__": 214 }, "_enabled": true, "__prefab": { - "__id__": 207 + "__id__": 232 }, "clickEvents": [ { - "__id__": 208 + "__id__": 233 } ], "_interactable": true, @@ -5094,23 +5664,23 @@ }, "_children": [ { - "__id__": 211 + "__id__": 236 } ], "_active": true, "_components": [ { - "__id__": 223 + "__id__": 248 }, { - "__id__": 225 + "__id__": 250 }, { - "__id__": 227 + "__id__": 252 } ], "_prefab": { - "__id__": 230 + "__id__": 255 }, "_lpos": { "__type__": "cc.Vec3", @@ -5147,24 +5717,24 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 210 + "__id__": 235 }, "_children": [ { - "__id__": 212 + "__id__": 237 } ], "_active": true, "_components": [ { - "__id__": 218 + "__id__": 243 }, { - "__id__": 220 + "__id__": 245 } ], "_prefab": { - "__id__": 222 + "__id__": 247 }, "_lpos": { "__type__": "cc.Vec3", @@ -5201,20 +5771,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 211 + "__id__": 236 }, "_children": [], "_active": true, "_components": [ { - "__id__": 213 + "__id__": 238 }, { - "__id__": 215 + "__id__": 240 } ], "_prefab": { - "__id__": 217 + "__id__": 242 }, "_lpos": { "__type__": "cc.Vec3", @@ -5251,11 +5821,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 212 + "__id__": 237 }, "_enabled": true, "__prefab": { - "__id__": 214 + "__id__": 239 }, "_contentSize": { "__type__": "cc.Size", @@ -5279,11 +5849,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 212 + "__id__": 237 }, "_enabled": true, "__prefab": { - "__id__": 216 + "__id__": 241 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -5340,11 +5910,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 211 + "__id__": 236 }, "_enabled": true, "__prefab": { - "__id__": 219 + "__id__": 244 }, "_contentSize": { "__type__": "cc.Size", @@ -5368,11 +5938,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 211 + "__id__": 236 }, "_enabled": true, "__prefab": { - "__id__": 221 + "__id__": 246 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -5429,11 +5999,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 210 + "__id__": 235 }, "_enabled": true, "__prefab": { - "__id__": 224 + "__id__": 249 }, "_contentSize": { "__type__": "cc.Size", @@ -5457,11 +6027,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 210 + "__id__": 235 }, "_enabled": true, "__prefab": { - "__id__": 226 + "__id__": 251 }, "_alignFlags": 4, "_target": null, @@ -5493,15 +6063,15 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 210 + "__id__": 235 }, "_enabled": true, "__prefab": { - "__id__": 228 + "__id__": 253 }, "clickEvents": [ { - "__id__": 229 + "__id__": 254 } ], "_interactable": true, @@ -5580,23 +6150,23 @@ }, "_children": [ { - "__id__": 232 + "__id__": 257 }, { - "__id__": 238 + "__id__": 263 } ], "_active": true, "_components": [ { - "__id__": 258 + "__id__": 283 }, { - "__id__": 260 + "__id__": 285 } ], "_prefab": { - "__id__": 262 + "__id__": 287 }, "_lpos": { "__type__": "cc.Vec3", @@ -5633,20 +6203,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 231 + "__id__": 256 }, "_children": [], "_active": true, "_components": [ { - "__id__": 233 + "__id__": 258 }, { - "__id__": 235 + "__id__": 260 } ], "_prefab": { - "__id__": 237 + "__id__": 262 }, "_lpos": { "__type__": "cc.Vec3", @@ -5683,11 +6253,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 232 + "__id__": 257 }, "_enabled": true, "__prefab": { - "__id__": 234 + "__id__": 259 }, "_contentSize": { "__type__": "cc.Size", @@ -5711,11 +6281,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 232 + "__id__": 257 }, "_enabled": true, "__prefab": { - "__id__": 236 + "__id__": 261 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -5772,27 +6342,27 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 231 + "__id__": 256 }, "_children": [ { - "__id__": 239 + "__id__": 264 }, { - "__id__": 247 + "__id__": 272 } ], "_active": true, "_components": [ { - "__id__": 253 + "__id__": 278 }, { - "__id__": 255 + "__id__": 280 } ], "_prefab": { - "__id__": 257 + "__id__": 282 }, "_lpos": { "__type__": "cc.Vec3", @@ -5829,23 +6399,23 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 238 + "__id__": 263 }, "_children": [], "_active": true, "_components": [ { - "__id__": 240 + "__id__": 265 }, { - "__id__": 242 + "__id__": 267 }, { - "__id__": 244 + "__id__": 269 } ], "_prefab": { - "__id__": 246 + "__id__": 271 }, "_lpos": { "__type__": "cc.Vec3", @@ -5882,11 +6452,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 239 + "__id__": 264 }, "_enabled": true, "__prefab": { - "__id__": 241 + "__id__": 266 }, "_contentSize": { "__type__": "cc.Size", @@ -5910,11 +6480,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 239 + "__id__": 264 }, "_enabled": true, "__prefab": { - "__id__": 243 + "__id__": 268 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -5978,11 +6548,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 239 + "__id__": 264 }, "_enabled": true, "__prefab": { - "__id__": 245 + "__id__": 270 }, "_alignFlags": 1, "_target": null, @@ -6027,20 +6597,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 238 + "__id__": 263 }, "_children": [], "_active": true, "_components": [ { - "__id__": 248 + "__id__": 273 }, { - "__id__": 250 + "__id__": 275 } ], "_prefab": { - "__id__": 252 + "__id__": 277 }, "_lpos": { "__type__": "cc.Vec3", @@ -6077,11 +6647,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 247 + "__id__": 272 }, "_enabled": true, "__prefab": { - "__id__": 249 + "__id__": 274 }, "_contentSize": { "__type__": "cc.Size", @@ -6105,11 +6675,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 247 + "__id__": 272 }, "_enabled": true, "__prefab": { - "__id__": 251 + "__id__": 276 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -6186,11 +6756,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 238 + "__id__": 263 }, "_enabled": true, "__prefab": { - "__id__": 254 + "__id__": 279 }, "_contentSize": { "__type__": "cc.Size", @@ -6214,11 +6784,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 238 + "__id__": 263 }, "_enabled": true, "__prefab": { - "__id__": 256 + "__id__": 281 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -6275,11 +6845,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 231 + "__id__": 256 }, "_enabled": true, "__prefab": { - "__id__": 259 + "__id__": 284 }, "_contentSize": { "__type__": "cc.Size", @@ -6303,11 +6873,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 231 + "__id__": 256 }, "_enabled": true, "__prefab": { - "__id__": 261 + "__id__": 286 }, "_alignFlags": 18, "_target": null, @@ -6356,7 +6926,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 264 + "__id__": 289 }, "_contentSize": { "__type__": "cc.Size", @@ -6384,7 +6954,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 266 + "__id__": 291 }, "_alignFlags": 21, "_target": null, @@ -6420,7 +6990,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 268 + "__id__": 293 }, "_id": "" }, @@ -6438,7 +7008,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 270 + "__id__": 295 }, "_id": "" }, @@ -6469,26 +7039,26 @@ }, "_children": [ { - "__id__": 273 + "__id__": 298 }, { - "__id__": 281 + "__id__": 306 } ], "_active": false, "_components": [ { - "__id__": 293 + "__id__": 318 }, { - "__id__": 295 + "__id__": 320 }, { - "__id__": 297 + "__id__": 322 } ], "_prefab": { - "__id__": 299 + "__id__": 324 }, "_lpos": { "__type__": "cc.Vec3", @@ -6525,23 +7095,23 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 272 + "__id__": 297 }, "_children": [], "_active": true, "_components": [ { - "__id__": 274 + "__id__": 299 }, { - "__id__": 276 + "__id__": 301 }, { - "__id__": 278 + "__id__": 303 } ], "_prefab": { - "__id__": 280 + "__id__": 305 }, "_lpos": { "__type__": "cc.Vec3", @@ -6578,11 +7148,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 273 + "__id__": 298 }, "_enabled": true, "__prefab": { - "__id__": 275 + "__id__": 300 }, "_contentSize": { "__type__": "cc.Size", @@ -6606,11 +7176,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 273 + "__id__": 298 }, "_enabled": true, "__prefab": { - "__id__": 277 + "__id__": 302 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -6654,11 +7224,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 273 + "__id__": 298 }, "_enabled": true, "__prefab": { - "__id__": 279 + "__id__": 304 }, "_alignFlags": 45, "_target": null, @@ -6701,17 +7271,17 @@ "__type__": "cc.Node", "_objFlags": 0, "_parent": { - "__id__": 272 + "__id__": 297 }, "_prefab": { - "__id__": 282 + "__id__": 307 }, "__editorExtras__": {} }, { "__type__": "cc.PrefabInfo", "root": { - "__id__": 281 + "__id__": 306 }, "asset": { "__uuid__": "9cc71d8c-192a-4234-8204-352f42b95c65", @@ -6719,7 +7289,7 @@ }, "fileId": "a0daVw8DRLi6ToMaTA0VS2", "instance": { - "__id__": 283 + "__id__": 308 }, "targetOverrides": null }, @@ -6733,22 +7303,22 @@ "mountedComponents": [], "propertyOverrides": [ { - "__id__": 284 + "__id__": 309 }, { - "__id__": 286 + "__id__": 311 }, { - "__id__": 287 + "__id__": 312 }, { - "__id__": 288 + "__id__": 313 }, { - "__id__": 289 + "__id__": 314 }, { - "__id__": 291 + "__id__": 316 } ], "removedComponents": [] @@ -6756,7 +7326,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 285 + "__id__": 310 }, "propertyPath": [ "_name" @@ -6772,7 +7342,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 285 + "__id__": 310 }, "propertyPath": [ "_lpos" @@ -6787,7 +7357,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 285 + "__id__": 310 }, "propertyPath": [ "_lrot" @@ -6803,7 +7373,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 285 + "__id__": 310 }, "propertyPath": [ "_euler" @@ -6818,7 +7388,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 290 + "__id__": 315 }, "propertyPath": [ "_contentSize" @@ -6838,7 +7408,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 292 + "__id__": 317 }, "propertyPath": [ "_contentSize" @@ -6861,11 +7431,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 272 + "__id__": 297 }, "_enabled": true, "__prefab": { - "__id__": 294 + "__id__": 319 }, "_contentSize": { "__type__": "cc.Size", @@ -6889,11 +7459,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 272 + "__id__": 297 }, "_enabled": true, "__prefab": { - "__id__": 296 + "__id__": 321 }, "_alignFlags": 45, "_target": null, @@ -6925,11 +7495,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 272 + "__id__": 297 }, "_enabled": true, "__prefab": { - "__id__": 298 + "__id__": 323 }, "_id": "" }, @@ -6960,23 +7530,23 @@ }, "_children": [ { - "__id__": 301 + "__id__": 326 } ], "_active": true, "_components": [ { - "__id__": 339 + "__id__": 364 }, { - "__id__": 341 + "__id__": 366 }, { - "__id__": 343 + "__id__": 368 } ], "_prefab": { - "__id__": 345 + "__id__": 370 }, "_lpos": { "__type__": "cc.Vec3", @@ -7013,30 +7583,30 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 300 + "__id__": 325 }, "_children": [ { - "__id__": 302 + "__id__": 327 } ], "_active": true, "_components": [ { - "__id__": 330 + "__id__": 355 }, { - "__id__": 332 + "__id__": 357 }, { - "__id__": 334 + "__id__": 359 }, { - "__id__": 336 + "__id__": 361 } ], "_prefab": { - "__id__": 338 + "__id__": 363 }, "_lpos": { "__type__": "cc.Vec3", @@ -7073,27 +7643,27 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 301 + "__id__": 326 }, "_children": [ { - "__id__": 303 + "__id__": 328 }, { - "__id__": 311 + "__id__": 336 }, { - "__id__": 317 + "__id__": 342 } ], "_active": true, "_components": [ { - "__id__": 327 + "__id__": 352 } ], "_prefab": { - "__id__": 329 + "__id__": 354 }, "_lpos": { "__type__": "cc.Vec3", @@ -7130,23 +7700,23 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 302 + "__id__": 327 }, "_children": [], "_active": true, "_components": [ { - "__id__": 304 + "__id__": 329 }, { - "__id__": 306 + "__id__": 331 }, { - "__id__": 308 + "__id__": 333 } ], "_prefab": { - "__id__": 310 + "__id__": 335 }, "_lpos": { "__type__": "cc.Vec3", @@ -7183,11 +7753,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 303 + "__id__": 328 }, "_enabled": true, "__prefab": { - "__id__": 305 + "__id__": 330 }, "_contentSize": { "__type__": "cc.Size", @@ -7211,11 +7781,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 303 + "__id__": 328 }, "_enabled": true, "__prefab": { - "__id__": 307 + "__id__": 332 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -7259,11 +7829,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 303 + "__id__": 328 }, "_enabled": true, "__prefab": { - "__id__": 309 + "__id__": 334 }, "_alignFlags": 40, "_target": null, @@ -7308,20 +7878,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 302 + "__id__": 327 }, "_children": [], "_active": true, "_components": [ { - "__id__": 312 + "__id__": 337 }, { - "__id__": 314 + "__id__": 339 } ], "_prefab": { - "__id__": 316 + "__id__": 341 }, "_lpos": { "__type__": "cc.Vec3", @@ -7358,11 +7928,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 311 + "__id__": 336 }, "_enabled": true, "__prefab": { - "__id__": 313 + "__id__": 338 }, "_contentSize": { "__type__": "cc.Size", @@ -7386,11 +7956,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 311 + "__id__": 336 }, "_enabled": true, "__prefab": { - "__id__": 315 + "__id__": 340 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -7447,26 +8017,26 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 302 + "__id__": 327 }, "_children": [], "_active": true, "_components": [ { - "__id__": 318 + "__id__": 343 }, { - "__id__": 320 + "__id__": 345 }, { - "__id__": 322 + "__id__": 347 }, { - "__id__": 324 + "__id__": 349 } ], "_prefab": { - "__id__": 326 + "__id__": 351 }, "_lpos": { "__type__": "cc.Vec3", @@ -7503,11 +8073,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 317 + "__id__": 342 }, "_enabled": true, "__prefab": { - "__id__": 319 + "__id__": 344 }, "_contentSize": { "__type__": "cc.Size", @@ -7531,11 +8101,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 317 + "__id__": 342 }, "_enabled": true, "__prefab": { - "__id__": 321 + "__id__": 346 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -7599,11 +8169,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 317 + "__id__": 342 }, "_enabled": true, "__prefab": { - "__id__": 323 + "__id__": 348 }, "_alignFlags": 10, "_target": null, @@ -7635,11 +8205,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 317 + "__id__": 342 }, "_enabled": true, "__prefab": { - "__id__": 325 + "__id__": 350 }, "templateMode": true, "watchPath": "data.data.gold", @@ -7672,11 +8242,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 302 + "__id__": 327 }, "_enabled": true, "__prefab": { - "__id__": 328 + "__id__": 353 }, "_contentSize": { "__type__": "cc.Size", @@ -7713,11 +8283,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 301 + "__id__": 326 }, "_enabled": true, "__prefab": { - "__id__": 331 + "__id__": 356 }, "_contentSize": { "__type__": "cc.Size", @@ -7741,11 +8311,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 301 + "__id__": 326 }, "_enabled": true, "__prefab": { - "__id__": 333 + "__id__": 358 }, "_alignFlags": 8, "_target": null, @@ -7777,11 +8347,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 301 + "__id__": 326 }, "_enabled": true, "__prefab": { - "__id__": 335 + "__id__": 360 }, "_resizeMode": 0, "_layoutType": 1, @@ -7815,11 +8385,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 301 + "__id__": 326 }, "_enabled": true, "__prefab": { - "__id__": 337 + "__id__": 362 }, "_alignFlags": 40, "_target": null, @@ -7864,11 +8434,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 300 + "__id__": 325 }, "_enabled": true, "__prefab": { - "__id__": 340 + "__id__": 365 }, "_contentSize": { "__type__": "cc.Size", @@ -7892,11 +8462,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 300 + "__id__": 325 }, "_enabled": true, "__prefab": { - "__id__": 342 + "__id__": 367 }, "_alignFlags": 17, "_target": null, @@ -7928,11 +8498,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 300 + "__id__": 325 }, "_enabled": true, "__prefab": { - "__id__": 344 + "__id__": 369 }, "_id": "" }, @@ -7963,7 +8533,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 347 + "__id__": 372 }, "_contentSize": { "__type__": "cc.Size", @@ -7991,7 +8561,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 349 + "__id__": 374 }, "_alignFlags": 45, "_target": null, @@ -8027,7 +8597,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 351 + "__id__": 376 }, "_id": "" }, @@ -8045,7 +8615,7 @@ }, "_enabled": false, "__prefab": { - "__id__": 353 + "__id__": 378 }, "_id": "" }, @@ -8066,7 +8636,7 @@ "targetOverrides": [], "nestedPrefabInstanceRoots": [ { - "__id__": 281 + "__id__": 306 } ] } diff --git a/assets/script/game/common/config/heroSet.ts b/assets/script/game/common/config/heroSet.ts index 3b24dafd..81c3511e 100644 --- a/assets/script/game/common/config/heroSet.ts +++ b/assets/script/game/common/config/heroSet.ts @@ -23,15 +23,16 @@ export const HTypeName ={ } //fac:FacSet.HERO -export const getHeroList = (quality:number=0)=>{ +export const getHeroList = ()=>{ const filteredHeros = Object.values(HeroInfo).filter(item=>{ const facMatch = item.fac === FacSet.HERO; return facMatch; }); - // 分离拥有和未拥有的英雄 - const ownedHeros = filteredHeros.filter(item => smc.heros.some(hero => hero.uuid === item.uuid)); - const unownedHeros = filteredHeros.filter(item => !smc.heros.some(hero => hero.uuid === item.uuid)); + // 根据smc.heros中的数据分离拥有和未拥有的英雄 + // smc.heros是一个包含英雄ID的数组,如[5001, 5002] + const ownedHeros = filteredHeros.filter(item => smc.heros.includes(item.uuid)); + const unownedHeros = filteredHeros.filter(item => !smc.heros.includes(item.uuid)); // 合并列表:拥有的在前,未拥有的在后 return [...ownedHeros, ...unownedHeros].map(item => item.uuid); diff --git a/assets/script/game/map/HInfoComp.ts b/assets/script/game/map/HInfoComp.ts index 6aa20b38..9dc8fa0b 100644 --- a/assets/script/game/map/HInfoComp.ts +++ b/assets/script/game/map/HInfoComp.ts @@ -66,7 +66,7 @@ export class HInfoComp extends CCComp { // 清除之前的英雄节点 this.claear_hero(); - // 获取英雄列表 + // 获取英雄列表(优先显示拥有的英雄) let heros = getHeroList(); let currentIndex = heros.indexOf(uuid); @@ -89,6 +89,7 @@ export class HInfoComp extends CCComp { // 载入英雄预制体并设置位置 this.heroNodes[i] = this.load_hui(heroUuid, i); } + this.is_lucky() } load_hui(uuid:number, pos_index: number){ var path = "game/gui/hui"; @@ -119,6 +120,9 @@ export class HInfoComp extends CCComp { mission_start(){ this.claear_hero() } + is_lucky(){ + this.node.getChildByName("buy").active=!smc.heros.includes(this.h_uuid) + } claear_hero(){ for (let i = 0; i < this.heroNodes.length; i++) { if (this.heroNodes[i]) { @@ -132,7 +136,7 @@ export class HInfoComp extends CCComp { // 检查是否正在动画中,防止快速点击导致的冲突 if (this.isMoving) return; - // 获取英雄列表 + // 获取英雄列表(优先显示拥有的英雄) let heros = getHeroList(); let index = heros.indexOf(this.h_uuid); index++; @@ -143,16 +147,16 @@ export class HInfoComp extends CCComp { this.h_uuid = nextHero; smc.updateFihgtHero(nextHero) this.update_data(nextHero); - // 执行平滑移动动画 this.moveHeroesRight(); + this.is_lucky() } prev_hero(){ // 检查是否正在动画中,防止快速点击导致的冲突 if (this.isMoving) return; - // 获取英雄列表 + // 获取英雄列表(优先显示拥有的英雄) let heros = getHeroList(); let index = heros.indexOf(this.h_uuid); index--; @@ -163,11 +167,21 @@ export class HInfoComp extends CCComp { this.h_uuid = prevHero; smc.updateFihgtHero(prevHero) this.update_data(prevHero); - // 执行平滑移动动画 this.moveHeroesLeft(); + this.is_lucky() + } + buy_hero(){ + console.info("[HInfoComp]:buy_hero",this.h_uuid) + this.node.getChildByName("buy").active=false + smc.addHero(this.h_uuid) + this.load_all_hero(this.h_uuid) + this.is_lucky() + } + start_mission() { + oops.message.dispatchEvent(GameEvent.MissionStart, {}) + this.node.active=false; } - moveHeroesLeft() { // 取消前一个待处理的异步操作 if (this.moveTimeoutId !== null) { diff --git a/assets/script/game/map/MissionHomeComp.ts b/assets/script/game/map/MissionHomeComp.ts index e7ea61cf..5441f095 100644 --- a/assets/script/game/map/MissionHomeComp.ts +++ b/assets/script/game/map/MissionHomeComp.ts @@ -26,10 +26,7 @@ export class MissionHomeComp extends CCComp { } - start_mission() { - oops.message.dispatchEvent(GameEvent.MissionStart, {}) - this.node.active=false; - } + mission_end(){ console.log("[MissionHomeComp]=>mission_end") this.home_active() @@ -37,8 +34,7 @@ export class MissionHomeComp extends CCComp { home_active(){ this.uodate_data() this.node.active=true - this.btn_func("","fight") - oops.message.dispatchEvent(GameEvent.UpdateHero, {}) + } uodate_data(){