feat: 增强存档管理和成就系统,添加事件通知以支持凹槽成就的动态更新
This commit is contained in:
@@ -51,7 +51,17 @@ namespace BaseGames.Core.Save
|
||||
}
|
||||
|
||||
// ── ISaveable 注册 ────────────────────────────────────────────────────
|
||||
public void Register(ISaveable s) => _saveables.Add(s);
|
||||
/// <summary>
|
||||
/// 注册 ISaveable。若当前已有存档数据(_current != null),
|
||||
/// 立即对该组件补发 OnLoad,使跨场景延迟注册的组件也能正确恢复状态。
|
||||
/// </summary>
|
||||
public void Register(ISaveable s)
|
||||
{
|
||||
if (!_saveables.Add(s)) return;
|
||||
if (_current != null)
|
||||
s.OnLoad(_current);
|
||||
}
|
||||
|
||||
public void Unregister(ISaveable s) => _saveables.Remove(s);
|
||||
|
||||
// ── 游玩时间追踪 ──────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user