feat: 新增英雄出售功能并优化UI交互

- 在 Hero 类中添加 removeByEid 静态方法,用于安全移除英雄实体
- 在 HInfoComp 中集成出售按钮逻辑,点击可移除对应英雄并关闭信息面板
- 为 card.prefab 和 hnode.prefab 添加召唤/出售按钮及相关UI组件
- 调整 role_controller.prefab 面板高度并禁用部分组件
- 移除未使用的 hit-flash-white 场景资源文件
- 暂时注释 CardComp 中的触摸事件绑定以进行调试
This commit is contained in:
walkpan
2026-03-28 12:04:41 +08:00
parent 47b8aeb789
commit a638f473a0
9 changed files with 753 additions and 1623 deletions

View File

@@ -47,19 +47,22 @@
},
{
"__id__": 150
},
{
"__id__": 196
}
],
"_active": true,
"_components": [
{
"__id__": 196
"__id__": 211
},
{
"__id__": 198
"__id__": 213
}
],
"_prefab": {
"__id__": 200
"__id__": 215
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -2279,7 +2282,7 @@
"__id__": 101
}
],
"_active": true,
"_active": false,
"_components": [
{
"__id__": 107
@@ -2530,7 +2533,7 @@
"a": 255
},
"_spriteFrame": {
"__uuid__": "6165ffc9-a838-4a33-b569-bdbaaab0e6b4@13f92",
"__uuid__": "6165ffc9-a838-4a33-b569-bdbaaab0e6b4@15f3b",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
@@ -4562,6 +4565,381 @@
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.Node",
"_name": "use",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 197
}
],
"_active": true,
"_components": [
{
"__id__": 203
},
{
"__id__": 205
},
{
"__id__": 207
}
],
"_prefab": {
"__id__": 210
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": -140.805,
"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": "Label",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 196
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 198
},
{
"__id__": 200
}
],
"_prefab": {
"__id__": 202
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 2,
"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__": 197
},
"_enabled": true,
"__prefab": {
"__id__": 199
},
"_contentSize": {
"__type__": "cc.Size",
"width": 60.94580078125,
"height": 54.4
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "eeZuu04rJFzoa4hbflZ24S"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 197
},
"_enabled": true,
"__prefab": {
"__id__": 201
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_string": "召 唤",
"_horizontalAlign": 1,
"_verticalAlign": 1,
"_actualFontSize": 25,
"_fontSize": 25,
"_fontFamily": "Arial",
"_lineHeight": 40,
"_overflow": 0,
"_enableWrapText": true,
"_font": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_isItalic": false,
"_isBold": false,
"_isUnderline": false,
"_underlineHeight": 2,
"_cacheMode": 0,
"_enableOutline": true,
"_outlineColor": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_outlineWidth": 2,
"_enableShadow": false,
"_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": "20iOHSh+RE9I1iLzeZ3LBi"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "0bHU/Up11A8YP6z6eGMtQU",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 196
},
"_enabled": true,
"__prefab": {
"__id__": 204
},
"_contentSize": {
"__type__": "cc.Size",
"width": 160,
"height": 45
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "106cH+DGZAxooglHMvE045"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 196
},
"_enabled": true,
"__prefab": {
"__id__": 206
},
"_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@15f3b",
"__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": {
"__uuid__": "6165ffc9-a838-4a33-b569-bdbaaab0e6b4",
"__expectedType__": "cc.SpriteAtlas"
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "81ukyY51tDrL2JwfvnGb6H"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 196
},
"_enabled": true,
"__prefab": {
"__id__": 208
},
"clickEvents": [
{
"__id__": 209
}
],
"_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": 1.2,
"_target": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "d5rlKxmj5A4Jw0V9vPZk0N"
},
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 1
},
"component": "",
"_componentId": "c4842RlEXFBsYWrZpIuY9c0",
"handler": "useCard",
"customEventData": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "ebG3ulmyZGU7zACc3IXmag",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
@@ -4572,7 +4950,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 197
"__id__": 212
},
"_contentSize": {
"__type__": "cc.Size",
@@ -4600,7 +4978,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 199
"__id__": 214
},
"Lock": {
"__id__": 100

File diff suppressed because it is too large Load Diff

View File

@@ -11739,7 +11739,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 720,
"height": 500
"height": 450
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@@ -11834,7 +11834,7 @@
"node": {
"__id__": 70
},
"_enabled": true,
"_enabled": false,
"__prefab": {
"__id__": 570
},