feat(界面): 为英雄信息组件添加出售按钮节点

- 在 HInfoComp 组件中新增 sell_node 属性用于关联出售按钮
- 在 hnode.prefab 中添加出售按钮节点及其子标签节点
- 调整现有节点的位置和缩放以适应新按钮的添加
This commit is contained in:
walkpan
2026-03-27 20:56:23 +08:00
parent 25cd0b419e
commit 79a0ed4798
3 changed files with 1696 additions and 1392 deletions

View File

@@ -32,19 +32,22 @@
},
{
"__id__": 74
},
{
"__id__": 98
}
],
"_active": true,
"_components": [
{
"__id__": 98
"__id__": 110
},
{
"__id__": 100
"__id__": 112
}
],
"_prefab": {
"__id__": 102
"__id__": 114
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -280,7 +283,7 @@
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 25.896,
"y": 45,
"z": 0
},
"_lrot": {
@@ -292,8 +295,8 @@
},
"_lscale": {
"__type__": "cc.Vec3",
"x": -1,
"y": 1,
"x": -1.5,
"y": 1.5,
"z": 1
},
"_mobility": 0,
@@ -1762,7 +1765,7 @@
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 62.444,
"y": 76.713,
"z": 0
},
"_lrot": {
@@ -2284,6 +2287,308 @@
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.Node",
"_name": "sell",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 99
}
],
"_active": true,
"_components": [
{
"__id__": 105
},
{
"__id__": 107
}
],
"_prefab": {
"__id__": 109
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": -95.425,
"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__": 98
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 100
},
{
"__id__": 102
}
],
"_prefab": {
"__id__": 104
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 2.007,
"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__": 99
},
"_enabled": true,
"__prefab": {
"__id__": 101
},
"_contentSize": {
"__type__": "cc.Size",
"width": 44,
"height": 54.4
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "18NQeaOHtH643bVxMxlzC/"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 99
},
"_enabled": true,
"__prefab": {
"__id__": 103
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_string": "出售",
"_horizontalAlign": 1,
"_verticalAlign": 1,
"_actualFontSize": 20,
"_fontSize": 20,
"_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": "89l+4jD8BLIrfkYGYOKmrV"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "1fpqKXZ+tC+LUBwL7n9siF",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 98
},
"_enabled": true,
"__prefab": {
"__id__": 106
},
"_contentSize": {
"__type__": "cc.Size",
"width": 110,
"height": 40
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "feZrk9RTtIEb/JioICZ8xt"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 98
},
"_enabled": true,
"__prefab": {
"__id__": 108
},
"_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@7645f",
"__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__": "6165ffc9-a838-4a33-b569-bdbaaab0e6b4",
"__expectedType__": "cc.SpriteAtlas"
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "28DFEDDLBFqpYWBwLgJM5a"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "19lplYfiZNyrEeHdxdeelx",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
@@ -2294,7 +2599,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 99
"__id__": 111
},
"_contentSize": {
"__type__": "cc.Size",
@@ -2322,11 +2627,14 @@
},
"_enabled": true,
"__prefab": {
"__id__": 101
"__id__": 113
},
"icon_node": {
"__id__": 10
},
"sell_node": {
"__id__": 98
},
"_id": ""
},
{

File diff suppressed because it is too large Load Diff

View File

@@ -14,6 +14,8 @@ const {property, ccclass } = _decorator;
export class HInfoComp extends CCComp {
@property(Node)
icon_node=null!
@property(Node)
sell_node=null!
private eid: number = 0;
private model: HeroAttrsComp | null = null;
private apLabel: Label | null = null;