地图系统

This commit is contained in:
2026-06-05 18:41:33 +08:00
parent 613f2a4d13
commit fe4fd60083
234 changed files with 33090 additions and 4899 deletions

View File

@@ -26,8 +26,9 @@ namespace BaseGames.UI
private void OnDeviceChanged(InputDeviceType _)
{
// 通过静态注册表刷新O(n) 遍历已启用实例,无需全场景搜索
InputIconImage.RefreshAll();
// InputIconImage 已通过订阅 IInputIconService.OnIconSetChanged 自主刷新,
// 无需重复调用 RefreshAll()——否则每次设备切换每个 InputIconImage 会执行两次 Refresh。
// 此处保留供将来添加设备切换时的其他 UI 响应(提示动画、音效反馈等)。
}
}
@@ -93,6 +94,14 @@ namespace BaseGames.UI
{
if (_image == null) return;
// 若组件在 IInputIconService 注册前 Enable此处补重试并补订阅
if (_iconService == null)
{
_iconService = ServiceLocator.GetOrDefault<IInputIconService>();
if (_iconService != null)
_iconService.OnIconSetChanged += Refresh;
}
Sprite sprite = null;
if (_mode == LookupMode.ByActionName && !string.IsNullOrEmpty(_actionName))