yyl
12 小时以前 3426606c42d2e94057e3c682890e26c8b50d9700
125 战斗 强制结束战斗问题修复
5个文件已修改
87 ■■■■ 已修改文件
Main/System/Battle/BattleField/BattleField.cs 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/BattleField/RecordActions/DeathRecordAction.cs 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/BattleHUDWin.cs 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/RecordPlayer/RecordPlayer.cs 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/Skill/SkillBase.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/BattleField/BattleField.cs
@@ -493,10 +493,7 @@
            //提供外部 胜利等奖励显示
            if (guid != "")
                EventBroadcast.Instance.Broadcast<string, JsonData>(EventName.BATTLE_END, guid, turnFightStateData);
            EventBroadcast.Instance.Broadcast<string, JsonData>(EventName.BATTLE_END, guid, turnFightStateData);
        });
        recordPlayer.PlayRecord(battleEndAction);
    }
@@ -528,10 +525,6 @@
        if (null != battleObj)
        {
            battleObj.buffMgr.RefreshBuff(vNetData);
        }
        else
        {
            Debug.LogError($"BattleObject with ID {vNetData.ObjID} not found for buff refresh.");
        }
    }
Main/System/Battle/BattleField/RecordActions/DeathRecordAction.cs
@@ -32,22 +32,26 @@
            foreach (var deadPack in deadPackList)
            {
                BattleObject deadObj = battleField.battleObjMgr.GetBattleObject((int)deadPack.ObjID);
                deadObj.OnDeath(() =>
                if (null != deadObj)
                {
                    index++;
                    isLastOne = index >= total;
                    OnDeathAnimationEnd(deadObj);
                    if (isLastOne)
                    deadObj.OnDeath(() =>
                    {
                        // UniTaskExtension.DelayTime((GameObject)null, 0.3f / battleField.speedRatio, () =>
                        // {
                            isFinish = true;
                        // });
                    }
                });
                        index++;
                        isLastOne = index >= total;
                        OnDeathAnimationEnd(deadObj);
                        if (isLastOne)
                        {
                            // UniTaskExtension.DelayTime((GameObject)null, 0.3f / battleField.speedRatio, () =>
                            // {
                                isFinish = true;
                            // });
                        }
                    });
                }
            }
            return;
        }
@@ -67,5 +71,6 @@
    {
        //  设置结束flag 记得清空motionBase里的事件
        base.ForceFinish();
    }
}
Main/System/Battle/BattleHUDWin.cs
@@ -4,6 +4,8 @@
using UnityEngine.UI;
using DG.Tweening;
using Cysharp.Threading.Tasks;
using System;
using LitJson;
//  这个界面是 persistent的界面
@@ -41,15 +43,36 @@
    {
        base.OnPreOpen();
        EventBroadcast.Instance.AddListener<BattleDmgInfo>(EventName.BATTLE_DAMAGE_TAKEN, OnDamageTaken);
        EventBroadcast.Instance.AddListener<string, JsonData>(EventName.BATTLE_END, OnBattleEnd);
        damagePrefabPool = GameObjectPoolManager.Instance.RequestPool(UILoader.LoadPrefab("DamageContent"));
        // buffIconPrefabPool = GameObjectPoolManager.Instance.RequestPool();
        // buffLabelPrefabPool = GameObjectPoolManager.Instance.RequestPool(ResManager.Instance.LoadAsset<GameObject>("UIComp", "BuffContent"));
    }
    private void OnBattleEnd(string guid, JsonData data)
    {
        ClearContent();
    }
    private void ClearContent()
    {
        // if (battleField.guid == guid)
        {
            for (int i = damageContentList.Count - 1; i >= 0; i--)
            {
                var content = damageContentList[i];
                content.Stop();
                RemoveDamageContent(content);
            }
            damageContentList.Clear();
        }
    }
    protected override void OnPreClose()
    {
        base.OnPreClose();
        EventBroadcast.Instance.RemoveListener<BattleDmgInfo>(EventName.BATTLE_DAMAGE_TAKEN, OnDamageTaken);
        EventBroadcast.Instance.RemoveListener<string, JsonData>(EventName.BATTLE_END, OnBattleEnd);
    }
    protected override void OnOpen()
@@ -82,6 +105,9 @@
    private void OnDamageTaken(BattleDmgInfo damageInfo)
    {
        if (battleField.IsBattleEnd())
            return;
        GameObject damageContent = damagePrefabPool.Request();
        DamageContent content = damageContent.GetComponent<DamageContent>();
        damageContent.transform.SetParent(damageNode, false);
@@ -115,6 +141,7 @@
        if (battleField != null)
        {
            battleField.OnBattlePause -= OnBattlePause;
            ClearContent();
        }
        battleField = _battleField;
Main/System/Battle/RecordPlayer/RecordPlayer.cs
@@ -88,7 +88,10 @@
            for (int i = removeIndexList.Count - 1; i >= 0; i--)
            {
                immediatelyActionList.RemoveAt(removeIndexList[i]);
                int index = removeIndexList[i];
                if (index < 0 || index >= immediatelyActionList.Count)
                    continue;
                immediatelyActionList.RemoveAt(index);
            }
        }
    }
@@ -158,7 +161,10 @@
    public void HaveRest()
    {
        ForceFinish();
        while (IsPlaying())
        {
            ForceFinish();
        }
    }
    public void ForceFinish()
Main/System/Battle/Skill/SkillBase.cs
@@ -681,6 +681,11 @@
    public virtual void ForceFinished()
    {
        skillEffect?.ForceFinished();
        if (otherSkillAction != null)
        {
            otherSkillAction.ForceFinish();
            otherSkillAction = null;
        }
        isFinished = true;
        moveFinished = true;
        isPlay = true;
@@ -694,12 +699,11 @@
            {
                if (combinePack.startTag.Tag.StartsWith("Skill_"))
                {
                    BattleDebug.LogError("other skill casting " + combinePack.startTag.Tag);
                    otherSkillAction = combinePack.CreateSkillAction();
                    otherSkillAction.fromSkillId = skillConfig.SkillID;
                    //    强制结束其他技能
                    otherSkillAction.ForceFinish();
                    return;
                    continue;
                }
            }
            else if (pack is CustomB421ActionPack actionPack)