UI系统优化
This commit is contained in:
26
Assets/_Game/Scripts/Spells/ISpellService.cs
Normal file
26
Assets/_Game/Scripts/Spells/ISpellService.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
|
||||
namespace BaseGames.Spells
|
||||
{
|
||||
/// <summary>
|
||||
/// 法术管理服务接口。UI 层(SpellSlotWidget)通过此接口读取法术状态,
|
||||
/// 与 SpellManager 具体实现解耦,支持测试场景下的 Mock 替换。
|
||||
/// </summary>
|
||||
public interface ISpellService
|
||||
{
|
||||
/// <summary>当前装备的法术;null 表示未装备。</summary>
|
||||
SpellSO EquippedSpell { get; }
|
||||
|
||||
/// <summary>冷却进度(0 = 就绪,1 = 刚施放)。</summary>
|
||||
float CooldownFraction { get; }
|
||||
|
||||
/// <summary>法术当前是否可施放(已装备且冷却完毕)。</summary>
|
||||
bool IsReady { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 法术装备或卸下时触发。参数为新法术,null 表示已卸下。
|
||||
/// UI 订阅此事件可实现零延迟的图标刷新,无需轮询。
|
||||
/// </summary>
|
||||
event Action<SpellSO> OnSpellChanged;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user