UI 系统
This commit is contained in:
@@ -54,18 +54,18 @@ namespace BaseGames.Player
|
||||
{
|
||||
ServiceLocator.GetOrDefault<ISaveableRegistry>()?.Register(this);
|
||||
if (_input == null) return;
|
||||
_input.SwitchSkyFormEvent += OnSwitchSky;
|
||||
_input.SwitchEarthFormEvent += OnSwitchEarth;
|
||||
_input.SwitchDeathFormEvent += OnSwitchDeath;
|
||||
_input.SwitchTianHunFormEvent += OnSwitchSky;
|
||||
_input.SwitchDiHunFormEvent += OnSwitchEarth;
|
||||
_input.SwitchMingHunFormEvent += OnSwitchDeath;
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
ServiceLocator.GetOrDefault<ISaveableRegistry>()?.Unregister(this);
|
||||
if (_input == null) return;
|
||||
_input.SwitchSkyFormEvent -= OnSwitchSky;
|
||||
_input.SwitchEarthFormEvent -= OnSwitchEarth;
|
||||
_input.SwitchDeathFormEvent -= OnSwitchDeath;
|
||||
_input.SwitchTianHunFormEvent -= OnSwitchSky;
|
||||
_input.SwitchDiHunFormEvent -= OnSwitchEarth;
|
||||
_input.SwitchMingHunFormEvent -= OnSwitchDeath;
|
||||
}
|
||||
|
||||
private void Start()
|
||||
|
||||
@@ -342,6 +342,9 @@ namespace BaseGames.Player
|
||||
}
|
||||
|
||||
// ── Abilities ─────────────────────────────────────────────────────────
|
||||
/// <summary>当前已解锁能力的位掩码快照(供能力总览 UI 遍历查询)。</summary>
|
||||
public AbilityType UnlockedAbilities => _unlockedAbilities;
|
||||
|
||||
public bool HasAbility(AbilityType ability)
|
||||
=> (_unlockedAbilities & ability) == ability;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user