feat(gui,logic): 优化战斗结算体验,新增延迟弹窗逻辑
1. 新增结算延迟机制,等待死亡动画播放完成后再弹出结算窗口 2. 调整金币道具、顶部UI、剪辑UI的尺寸、位置和贴图资源 3. 修复重复触发结算的问题,增加调度状态校验
This commit is contained in:
@@ -1182,8 +1182,8 @@
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": -0.088,
|
||||
"y": -2.829,
|
||||
"x": 0,
|
||||
"y": -2.823,
|
||||
"z": 0
|
||||
},
|
||||
"_lrot": {
|
||||
@@ -1195,8 +1195,8 @@
|
||||
},
|
||||
"_lscale": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": -1,
|
||||
"y": 1,
|
||||
"x": -1.3,
|
||||
"y": 1.3,
|
||||
"z": 1
|
||||
},
|
||||
"_mobility": 0,
|
||||
@@ -1312,8 +1312,8 @@
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 45,
|
||||
"height": 45
|
||||
"width": 55,
|
||||
"height": 55
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -414,8 +414,8 @@
|
||||
},
|
||||
"_lscale": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 1,
|
||||
"y": 1,
|
||||
"x": 0.4,
|
||||
"y": 0.4,
|
||||
"z": 1
|
||||
},
|
||||
"_mobility": 0,
|
||||
@@ -442,8 +442,8 @@
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 38,
|
||||
"height": 42
|
||||
"width": 112,
|
||||
"height": 116
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
@@ -479,7 +479,7 @@
|
||||
"a": 255
|
||||
},
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73@a9695",
|
||||
"__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73@23e64",
|
||||
"__expectedType__": "cc.SpriteFrame"
|
||||
},
|
||||
"_type": 1,
|
||||
@@ -494,7 +494,10 @@
|
||||
"_fillRange": 0,
|
||||
"_isTrimmedMode": true,
|
||||
"_useGrayscale": false,
|
||||
"_atlas": null,
|
||||
"_atlas": {
|
||||
"__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73",
|
||||
"__expectedType__": "cc.SpriteAtlas"
|
||||
},
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
|
||||
@@ -681,8 +681,8 @@
|
||||
},
|
||||
"_lscale": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 1,
|
||||
"y": 1,
|
||||
"x": 0.5,
|
||||
"y": 0.5,
|
||||
"z": 1
|
||||
},
|
||||
"_mobility": 0,
|
||||
@@ -709,8 +709,8 @@
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 54,
|
||||
"height": 54
|
||||
"width": 112,
|
||||
"height": 116
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
@@ -746,7 +746,7 @@
|
||||
"a": 255
|
||||
},
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "6165ffc9-a838-4a33-b569-bdbaaab0e6b4@ec5a5",
|
||||
"__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73@23e64",
|
||||
"__expectedType__": "cc.SpriteFrame"
|
||||
},
|
||||
"_type": 0,
|
||||
@@ -762,7 +762,7 @@
|
||||
"_isTrimmedMode": true,
|
||||
"_useGrayscale": false,
|
||||
"_atlas": {
|
||||
"__uuid__": "6165ffc9-a838-4a33-b569-bdbaaab0e6b4",
|
||||
"__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73",
|
||||
"__expectedType__": "cc.SpriteAtlas"
|
||||
},
|
||||
"_id": ""
|
||||
@@ -1052,7 +1052,7 @@
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "d",
|
||||
"_name": "e",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"_parent": {
|
||||
@@ -1080,7 +1080,7 @@
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": -170,
|
||||
"x": -155.6,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
@@ -1186,7 +1186,7 @@
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "c4hSLRJthGgoi4nNIApWoP"
|
||||
"fileId": "7bH/vIPTNMtIyleXl3BZQd"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Sprite",
|
||||
@@ -1234,7 +1234,7 @@
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "3cRp2dwMhJUofXCgf1KfZv"
|
||||
"fileId": "6cs+3B0JZCNYrWoZRfOBic"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Widget",
|
||||
@@ -1270,7 +1270,7 @@
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "b1RcKa0l5DrIUhrm/mxjHZ"
|
||||
"fileId": "0b+rAgWk5JzJoTxi+I+dBj"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
@@ -1280,7 +1280,7 @@
|
||||
"asset": {
|
||||
"__id__": 0
|
||||
},
|
||||
"fileId": "6643ZtGYBNV5KsgfwiW4Sr",
|
||||
"fileId": "c0NzzN949Df66BiTJmMPTC",
|
||||
"instance": null,
|
||||
"targetOverrides": null,
|
||||
"nestedPrefabInstanceRoots": null
|
||||
@@ -1308,7 +1308,7 @@
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": -3.5,
|
||||
"x": -15.045,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
@@ -1349,8 +1349,8 @@
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 116,
|
||||
"height": 102
|
||||
"width": 112,
|
||||
"height": 116
|
||||
},
|
||||
"_anchorPoint": {
|
||||
"__type__": "cc.Vec2",
|
||||
@@ -1361,7 +1361,7 @@
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "b7jJoxfOhMM4o9JXyco8X6"
|
||||
"fileId": "cd5KtygVVOM6KMPVDHlVsW"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Sprite",
|
||||
@@ -1386,7 +1386,7 @@
|
||||
"a": 255
|
||||
},
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "6165ffc9-a838-4a33-b569-bdbaaab0e6b4@72d46",
|
||||
"__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73@4b5bf",
|
||||
"__expectedType__": "cc.SpriteFrame"
|
||||
},
|
||||
"_type": 0,
|
||||
@@ -1402,14 +1402,14 @@
|
||||
"_isTrimmedMode": true,
|
||||
"_useGrayscale": false,
|
||||
"_atlas": {
|
||||
"__uuid__": "6165ffc9-a838-4a33-b569-bdbaaab0e6b4",
|
||||
"__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73",
|
||||
"__expectedType__": "cc.SpriteAtlas"
|
||||
},
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "bbCtfdar1B+6ewjxXVzsjy"
|
||||
"fileId": "7cm7odaIBFAJ7gpc4BEAQx"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
@@ -1419,7 +1419,7 @@
|
||||
"asset": {
|
||||
"__id__": 0
|
||||
},
|
||||
"fileId": "8cMYdjOD9ODq5zYo0ytDbQ",
|
||||
"fileId": "4ca9VglC1HlpPAJFxvJFro",
|
||||
"instance": null,
|
||||
"targetOverrides": null,
|
||||
"nestedPrefabInstanceRoots": null
|
||||
@@ -1506,7 +1506,7 @@
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "3eVOSU899HK5c+prOgrtbn"
|
||||
"fileId": "61KsYpKvVGY46K6ba6F9gp"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Label",
|
||||
@@ -1574,7 +1574,7 @@
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "39BUQj++9DF4SRMH5iU1ix"
|
||||
"fileId": "d1XfM3UIRFs4GJtIMUdF7Y"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Widget",
|
||||
@@ -1610,7 +1610,7 @@
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "3emAN/CtVJO6useKFht3/3"
|
||||
"fileId": "e4corkZglP/qQ9HjHWPGIa"
|
||||
},
|
||||
{
|
||||
"__type__": "545c05XsG9GDJispEGWKvYv",
|
||||
@@ -1628,13 +1628,13 @@
|
||||
"watchPath": "data.data.gold",
|
||||
"labelType": "cc.Label",
|
||||
"watchPathArr": [
|
||||
"data.diamond"
|
||||
"data.gold"
|
||||
],
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "98DccPlIVKvbZTnuK78Miu"
|
||||
"fileId": "54MvQIYu1Apq9a/Cjr8wJp"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
@@ -1644,7 +1644,7 @@
|
||||
"asset": {
|
||||
"__id__": 0
|
||||
},
|
||||
"fileId": "43bky+pjpPbrd5yGx2HpZN",
|
||||
"fileId": "cb0/5phvBADaUxyuS4YKGj",
|
||||
"instance": null,
|
||||
"targetOverrides": null,
|
||||
"nestedPrefabInstanceRoots": null
|
||||
@@ -1675,7 +1675,7 @@
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "7eFUi8IDBHqrP0Nm/62VBy"
|
||||
"fileId": "224IhhfT1O0LNlU42cAaqJ"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
@@ -1685,14 +1685,14 @@
|
||||
"asset": {
|
||||
"__id__": 0
|
||||
},
|
||||
"fileId": "ea7xvppihL5YmBwpjMWuTS",
|
||||
"fileId": "e5B5BcrSNN2opVBZBjK/dT",
|
||||
"instance": null,
|
||||
"targetOverrides": null,
|
||||
"nestedPrefabInstanceRoots": null
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "e",
|
||||
"_name": "d",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"_parent": {
|
||||
@@ -1720,7 +1720,7 @@
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": -15,
|
||||
"x": 13.800000000000004,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
@@ -1826,7 +1826,7 @@
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "7bH/vIPTNMtIyleXl3BZQd"
|
||||
"fileId": "c4hSLRJthGgoi4nNIApWoP"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Sprite",
|
||||
@@ -1874,7 +1874,7 @@
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "6cs+3B0JZCNYrWoZRfOBic"
|
||||
"fileId": "3cRp2dwMhJUofXCgf1KfZv"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Widget",
|
||||
@@ -1910,7 +1910,7 @@
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "0b+rAgWk5JzJoTxi+I+dBj"
|
||||
"fileId": "b1RcKa0l5DrIUhrm/mxjHZ"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
@@ -1920,7 +1920,7 @@
|
||||
"asset": {
|
||||
"__id__": 0
|
||||
},
|
||||
"fileId": "c0NzzN949Df66BiTJmMPTC",
|
||||
"fileId": "6643ZtGYBNV5KsgfwiW4Sr",
|
||||
"instance": null,
|
||||
"targetOverrides": null,
|
||||
"nestedPrefabInstanceRoots": null
|
||||
@@ -1948,7 +1948,7 @@
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": -3.5,
|
||||
"x": -15.045,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
@@ -1989,7 +1989,7 @@
|
||||
},
|
||||
"_contentSize": {
|
||||
"__type__": "cc.Size",
|
||||
"width": 86,
|
||||
"width": 122,
|
||||
"height": 106
|
||||
},
|
||||
"_anchorPoint": {
|
||||
@@ -2001,7 +2001,7 @@
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "cd5KtygVVOM6KMPVDHlVsW"
|
||||
"fileId": "b7jJoxfOhMM4o9JXyco8X6"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Sprite",
|
||||
@@ -2026,7 +2026,7 @@
|
||||
"a": 255
|
||||
},
|
||||
"_spriteFrame": {
|
||||
"__uuid__": "6165ffc9-a838-4a33-b569-bdbaaab0e6b4@47087",
|
||||
"__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73@d2cb1",
|
||||
"__expectedType__": "cc.SpriteFrame"
|
||||
},
|
||||
"_type": 0,
|
||||
@@ -2042,14 +2042,14 @@
|
||||
"_isTrimmedMode": true,
|
||||
"_useGrayscale": false,
|
||||
"_atlas": {
|
||||
"__uuid__": "6165ffc9-a838-4a33-b569-bdbaaab0e6b4",
|
||||
"__uuid__": "cb93c900-b440-4571-91d1-7da1636e3d73",
|
||||
"__expectedType__": "cc.SpriteAtlas"
|
||||
},
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "7cm7odaIBFAJ7gpc4BEAQx"
|
||||
"fileId": "bbCtfdar1B+6ewjxXVzsjy"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
@@ -2059,7 +2059,7 @@
|
||||
"asset": {
|
||||
"__id__": 0
|
||||
},
|
||||
"fileId": "4ca9VglC1HlpPAJFxvJFro",
|
||||
"fileId": "8cMYdjOD9ODq5zYo0ytDbQ",
|
||||
"instance": null,
|
||||
"targetOverrides": null,
|
||||
"nestedPrefabInstanceRoots": null
|
||||
@@ -2146,7 +2146,7 @@
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "61KsYpKvVGY46K6ba6F9gp"
|
||||
"fileId": "3eVOSU899HK5c+prOgrtbn"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Label",
|
||||
@@ -2214,7 +2214,7 @@
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "d1XfM3UIRFs4GJtIMUdF7Y"
|
||||
"fileId": "39BUQj++9DF4SRMH5iU1ix"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Widget",
|
||||
@@ -2250,7 +2250,7 @@
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "e4corkZglP/qQ9HjHWPGIa"
|
||||
"fileId": "3emAN/CtVJO6useKFht3/3"
|
||||
},
|
||||
{
|
||||
"__type__": "545c05XsG9GDJispEGWKvYv",
|
||||
@@ -2268,13 +2268,13 @@
|
||||
"watchPath": "data.data.gold",
|
||||
"labelType": "cc.Label",
|
||||
"watchPathArr": [
|
||||
"data.gold"
|
||||
"data.diamond"
|
||||
],
|
||||
"_id": ""
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "54MvQIYu1Apq9a/Cjr8wJp"
|
||||
"fileId": "98DccPlIVKvbZTnuK78Miu"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
@@ -2284,7 +2284,7 @@
|
||||
"asset": {
|
||||
"__id__": 0
|
||||
},
|
||||
"fileId": "cb0/5phvBADaUxyuS4YKGj",
|
||||
"fileId": "43bky+pjpPbrd5yGx2HpZN",
|
||||
"instance": null,
|
||||
"targetOverrides": null,
|
||||
"nestedPrefabInstanceRoots": null
|
||||
@@ -2315,7 +2315,7 @@
|
||||
},
|
||||
{
|
||||
"__type__": "cc.CompPrefabInfo",
|
||||
"fileId": "224IhhfT1O0LNlU42cAaqJ"
|
||||
"fileId": "7eFUi8IDBHqrP0Nm/62VBy"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.PrefabInfo",
|
||||
@@ -2325,7 +2325,7 @@
|
||||
"asset": {
|
||||
"__id__": 0
|
||||
},
|
||||
"fileId": "e5B5BcrSNN2opVBZBjK/dT",
|
||||
"fileId": "ea7xvppihL5YmBwpjMWuTS",
|
||||
"instance": null,
|
||||
"targetOverrides": null,
|
||||
"nestedPrefabInstanceRoots": null
|
||||
@@ -2418,7 +2418,7 @@
|
||||
"_paddingRight": 0,
|
||||
"_paddingTop": 0,
|
||||
"_paddingBottom": 0,
|
||||
"_spacingX": 15,
|
||||
"_spacingX": 29.4,
|
||||
"_spacingY": 0,
|
||||
"_verticalDirection": 1,
|
||||
"_horizontalDirection": 0,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
Before Width: | Height: | Size: 973 KiB After Width: | Height: | Size: 962 KiB |
@@ -171,6 +171,10 @@ export class MissionComp extends CCComp {
|
||||
private isWaveCountdown: boolean = false;
|
||||
/** 本局是否胜利(open_Victory 时记录,供结算弹窗使用) */
|
||||
private _victory: boolean = false;
|
||||
/** 结算弹窗延迟(秒):等待最后一个英雄/怪物死亡动画播完再切 BattleEnd */
|
||||
private static readonly SETTLE_DELAY = 1.5;
|
||||
/** 结算是否已预约调度(防止 0.2s 同步周期内重复 scheduleOnce) */
|
||||
private _settleScheduled: boolean = false;
|
||||
|
||||
// ======================== ECS 查询匹配器(预缓存) ========================
|
||||
|
||||
@@ -913,7 +917,8 @@ export class MissionComp extends CCComp {
|
||||
allAlive,
|
||||
fastClear,
|
||||
});
|
||||
this.open_Victory(null, false, true);
|
||||
// 最后一个怪物死亡:延迟结算,等待死亡动画播放完再弹窗
|
||||
this.scheduleSettle(false, true);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -934,14 +939,32 @@ export class MissionComp extends CCComp {
|
||||
}
|
||||
|
||||
/**
|
||||
* 英雄全灭检测:若场上无存活英雄且处于战斗中,触发结算弹窗。
|
||||
* 英雄全灭检测:若场上无存活英雄且处于战斗中,预约延迟结算(等待死亡动画播完再弹窗)。
|
||||
* @param heroCount 当前存活英雄数量
|
||||
*/
|
||||
private handleHeroWipe(heroCount: number) {
|
||||
if (heroCount > 0) return;
|
||||
if (!smc.mission.play || smc.mission.pause) return;
|
||||
if (this.currentPhase !== MissionPhase.Battle) return;
|
||||
this.open_Victory(null, true);
|
||||
this.scheduleSettle(true, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 预约延迟结算:最后一个英雄/怪物死亡时,延迟 SETTLE_DELAY 秒等待死亡动画播完,
|
||||
* 再切入 BattleEnd(由 autoNextPhase 流转弹窗),避免结算窗立即盖住死亡表现。
|
||||
* @param is_hero_dead 是否因英雄全灭触发
|
||||
* @param victory 是否胜利
|
||||
*/
|
||||
private scheduleSettle(is_hero_dead: boolean, victory: boolean) {
|
||||
if (this._settleScheduled) return;
|
||||
this._settleScheduled = true;
|
||||
this.scheduleOnce(() => {
|
||||
this._settleScheduled = false;
|
||||
// 延迟期间局内状态可能已变化(如复活、任务结束),兜底校验
|
||||
if (!smc.mission.play || smc.mission.pause) return;
|
||||
if (this.currentPhase !== MissionPhase.Battle) return;
|
||||
this.open_Victory(null, is_hero_dead, victory);
|
||||
}, MissionComp.SETTLE_DELAY);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user