yyl
2025-11-27 7c76f6a3b938adac52d0337259fa5b603da2ec66
Main/System/Battle/BattleField/BattleField.cs
@@ -13,6 +13,8 @@
    public Action<float> OnSpeedRatioChange; // 添加战斗速度变化的回调
    public Action<bool> OnFocusChange;
    public Action OnBattleRun; // 添加战斗运行时的回调
    public BattleObjMgr battleObjMgr;
@@ -56,6 +58,8 @@
        }
    }
    protected bool isFocus = false;
    public BattleRootNode battleRootNode;
    private BattleMode battleMode;
    public event Action<BattleMode> ChangeBattleModeEvent;
@@ -67,6 +71,8 @@
    // 记录正在处理死亡的角色ID,防止重复处理
    private HashSet<uint> processingDeathObjIds = new HashSet<uint>();
    public BattleSoundManager soundManager;
#if UNITY_EDITOR
    public static Dictionary<string, string> battleHpRecorder = new Dictionary<string, string>();
@@ -85,6 +91,7 @@
        battleEffectMgr = new BattleEffectMgr();
        battleTweenMgr = new BattleTweenMgr();
        recordPlayer = new RecordPlayer();
        soundManager = new BattleSoundManager(this);
        processingDeathObjIds = new HashSet<uint>();
    }
@@ -519,6 +526,8 @@
        //         adjuster.SetParentCanvas(canvas);
        //     }
        // }
        BattleManager.Instance.FocusBattleField(this);
    }
    public void StartBattle(Action onMoveComplete)
@@ -730,4 +739,15 @@
    }
    public void SetFocus(bool v)
    {
        isFocus = v;
        OnFocusChange?.Invoke(isFocus);
    }
    public bool IsFocus()
    {
        return isFocus;
    }
}