- 规范 UI 设计成为:

- UIForm 负责展示
    - Controller 负责控制
    - UseCase 负责业务逻辑
    - RawData 负责提供原始数据
    - Context 负责为 UIForm 提供数据
- 添加和补充一系列 UI 功能
This commit is contained in:
SepComet
2026-02-16 19:03:09 +08:00
parent d650dd63e7
commit 85b0205c73
251 changed files with 12705 additions and 5220 deletions
@@ -38,6 +38,10 @@ namespace Components
/// </summary>
[SerializeField] private Transform[] _weaponSlots;
public IReadOnlyList<WeaponBase> Weapons => _weapons;
public IReadOnlyList<PropItem> Props => _props;
public int WeaponCapacity => _weaponCapacity;
public void OnInit(Player player, int weaponCapacity)
{
_weaponCapacity = weaponCapacity;
@@ -97,4 +101,4 @@ namespace Components
}
}
}
}
}
@@ -51,7 +51,10 @@ namespace Components
{
_maxHealthStat = _statComponent.GetStat(StatType.MaxHealth);
_maxHealthStatCallback = (modifier, isApply) =>
{
_statComponent.UpdateStat(_maxHealthStat, modifier, isApply);
GameEntry.Event.Fire(this, PlayerHealthChangeEventArgs.Create(0, CurrentHealth, MaxHealth));
};
_statComponent.Subscribe(StatType.MaxHealth, _maxHealthStatCallback);
_defenseStat = _statComponent.GetStat(StatType.Defense);