UI系统优化
This commit is contained in:
@@ -15,7 +15,7 @@ namespace BaseGames.Equipment
|
||||
/// 挂在 Player 上,管理护符的装备/卸下及 Notch 容量。
|
||||
/// 实现 ISaveable 以持久化装备状态。
|
||||
/// </summary>
|
||||
public class EquipmentManager : MonoBehaviour, ISaveable
|
||||
public class EquipmentManager : MonoBehaviour, ISaveable, IEquipmentService
|
||||
{
|
||||
[Header("配置")]
|
||||
[SerializeField] private EquipmentConfigSO _config;
|
||||
@@ -40,12 +40,14 @@ namespace BaseGames.Equipment
|
||||
// ── 生命周期 ──────────────────────────────────────────────────────────
|
||||
private void OnEnable()
|
||||
{
|
||||
ServiceLocator.Register<IEquipmentService>(this);
|
||||
ServiceLocator.GetOrDefault<ISaveableRegistry>()?.Register(this);
|
||||
_onAchievementNotchGranted?.Subscribe(() => IncreaseNotches(1)).AddTo(_subs);
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
ServiceLocator.Unregister<IEquipmentService>(this);
|
||||
ServiceLocator.GetOrDefault<ISaveableRegistry>()?.Unregister(this);
|
||||
_subs.Clear();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user