多轮审查和修复

This commit is contained in:
2026-05-12 15:34:08 +08:00
parent f55d2a57c3
commit ebbbb7332e
805 changed files with 838724 additions and 1905 deletions

View File

@@ -0,0 +1,33 @@
using UnityEngine;
using BaseGames.Core.Events;
namespace BaseGames.Progression
{
/// <summary>
/// Boss 进程追踪器(架构 09_ProgressionModule §13
/// 挂载在 Boss 房间的 BossTrigger 同一对象上。
/// 监听 _onBossDefeated 事件,路由到 SaveSystem 专用频道(零耦合)。
/// </summary>
public class BossProgressTracker : MonoBehaviour
{
[SerializeField] private string _bossId; // 如 "Boss_SpiderGuard"
[SerializeField] private string[] _unlocksProgressLockIds; // 击败后应解锁的 ProgressLock ID预留
[Header("Event Channels")]
[SerializeField] private StringEventChannelSO _onBossDefeated; // 监听(来自 BossCombat
[SerializeField] private StringEventChannelSO _onBossDefeatedForSave; // 广播 → SaveSystem
private readonly CompositeDisposable _subs = new();
private void OnEnable() => _onBossDefeated?.Subscribe(OnBossDefeated).AddTo(_subs);
private void OnDisable() => _subs.Clear();
private void OnBossDefeated(string bossId)
{
if (bossId != _bossId) return;
// 通过事件频道通知 SaveSystemSaveSystem 负责写入 data.World.DefeatedBossIds
_onBossDefeatedForSave?.Raise(bossId);
}
}
}