feat: 优化存档管理,增强链状态获取逻辑,添加 ISaveable 接口支持

This commit is contained in:
2026-05-20 16:37:32 +08:00
parent acb36d750f
commit 04aec4cc8e
4 changed files with 51 additions and 35 deletions

View File

@@ -1,4 +1,5 @@
using UnityEngine;
using BaseGames.Core;
using BaseGames.Core.Events;
using BaseGames.Core.Save;
using BaseGames.Player.States;
@@ -26,6 +27,9 @@ namespace BaseGames.Equipment
Debug.Assert(_toolCatalog != null, "[ToolSlotManager] _toolCatalog 未赋值,请在 Inspector 中指定 ToolCatalogSO。", this);
}
private void OnEnable() => ServiceLocator.GetOrDefault<ISaveableRegistry>()?.Register(this);
private void OnDisable() => ServiceLocator.GetOrDefault<ISaveableRegistry>()?.Unregister(this);
// ── 装备 ─────────────────────────────────────────────────────────────
public void EquipTool(int slotIndex, ToolSO tool)
{