地图系统
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user