feat(界面): 修改战斗结束逻辑并添加复活按钮

- 将战斗结束事件处理从"to_end_fight"改为"open_Victory"
- 将MissionHeroComp中的FightEnd事件监听改为MissionEnd
- 在胜利界面添加"满血复活"按钮及相关组件
- 调整部分节点位置和激活状态
This commit is contained in:
walkpan
2026-01-03 18:05:58 +08:00
parent cade854fc7
commit acb564123d
3 changed files with 400 additions and 22 deletions

View File

@@ -31,23 +31,23 @@
"_active": true,
"_components": [
{
"__id__": 74
"__id__": 89
},
{
"__id__": 76
"__id__": 91
},
{
"__id__": 78
"__id__": 93
},
{
"__id__": 80
"__id__": 95
},
{
"__id__": 82
"__id__": 97
}
],
"_prefab": {
"__id__": 84
"__id__": 99
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -883,22 +883,25 @@
},
{
"__id__": 52
},
{
"__id__": 67
}
],
"_active": true,
"_components": [
{
"__id__": 67
"__id__": 82
},
{
"__id__": 69
"__id__": 84
},
{
"__id__": 71
"__id__": 86
}
],
"_prefab": {
"__id__": 73
"__id__": 88
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -1317,7 +1320,7 @@
"__id__": 53
}
],
"_active": true,
"_active": false,
"_components": [
{
"__id__": 59
@@ -1334,7 +1337,7 @@
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 142.5,
"x": -72.5,
"y": 0,
"z": 0
},
@@ -1679,6 +1682,381 @@
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.Node",
"_name": "alive",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 36
},
"_children": [
{
"__id__": 68
}
],
"_active": true,
"_components": [
{
"__id__": 74
},
{
"__id__": 76
},
{
"__id__": 78
}
],
"_prefab": {
"__id__": 81
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 142.5,
"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": "Label",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 67
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 69
},
{
"__id__": 71
}
],
"_prefab": {
"__id__": 73
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 5,
"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__": 68
},
"_enabled": true,
"__prefab": {
"__id__": 70
},
"_contentSize": {
"__type__": "cc.Size",
"width": 164,
"height": 54.4
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "c9ZHfMuLhJWbwbUsAARnI1"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 68
},
"_enabled": true,
"__prefab": {
"__id__": 72
},
"_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": "20xhUPrNxE2IhtUrQwt6lf"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "1ep12DimFFob05VzOM4ae+",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 67
},
"_enabled": true,
"__prefab": {
"__id__": 75
},
"_contentSize": {
"__type__": "cc.Size",
"width": 400,
"height": 100
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "aeo5zMZEdM+IFTlxJtSCYW"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 67
},
"_enabled": true,
"__prefab": {
"__id__": 77
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "deedea09-8f2b-400f-9803-4cfd38e45d1a@e556e",
"__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__": "deedea09-8f2b-400f-9803-4cfd38e45d1a",
"__expectedType__": "cc.SpriteAtlas"
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "51jXGPgOJCypLDV5JTud8V"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 67
},
"_enabled": true,
"__prefab": {
"__id__": 79
},
"clickEvents": [
{
"__id__": 80
}
],
"_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": "d8wEcoBxFNL5n0Jfgwg98G"
},
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 1
},
"component": "",
"_componentId": "463c7iN7clDbLBuuJ6fqWQv",
"handler": "watch_ad_revive",
"customEventData": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "b1SosIOQZI9aIddnpDIO4e",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
@@ -1689,7 +2067,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 68
"__id__": 83
},
"_contentSize": {
"__type__": "cc.Size",
@@ -1717,7 +2095,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 70
"__id__": 85
},
"_resizeMode": 1,
"_layoutType": 1,
@@ -1755,7 +2133,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 72
"__id__": 87
},
"_alignFlags": 4,
"_target": null,
@@ -1804,7 +2182,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 75
"__id__": 90
},
"_contentSize": {
"__type__": "cc.Size",
@@ -1832,7 +2210,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 77
"__id__": 92
},
"_id": ""
},
@@ -1850,7 +2228,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 79
"__id__": 94
},
"_alignFlags": 45,
"_target": null,
@@ -1886,7 +2264,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 81
"__id__": 96
},
"_customMaterial": null,
"_srcBlendFactor": 2,
@@ -1928,7 +2306,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 83
"__id__": 98
},
"_id": ""
},

View File

@@ -9935,7 +9935,7 @@
},
"component": "",
"_componentId": "e7482dUVpJEJZzHkqJl1ZWP",
"handler": "to_end_fight",
"handler": "open_Victory",
"customEventData": ""
},
{

View File

@@ -20,7 +20,7 @@ export class MissionHeroCompComp extends CCComp {
onLoad(){
this.on(GameEvent.FightReady,this.fight_ready,this)
this.on(GameEvent.Zhaohuan,this.zhao_huan,this)
this.on(GameEvent.FightEnd,this.clear_heros,this)
this.on(GameEvent.MissionEnd,this.clear_heros,this)
}
start() {
// this.test_call()