Files
zeling_v2/Assets/_Game/Scripts/UI/IInputIconService.cs
Joywayer e879efaa89 Add InputDeviceIconSetSO configuration guide and related documentation
- Created a new markdown file detailing the configuration of InputDeviceIconSetSO.
- Included sections on system architecture, field explanations, image specifications, and complete workflow from setup to runtime.
- Documented the automatic device recognition logic and provided troubleshooting for common issues.
- Added references to relevant files and scripts for easier navigation.
2026-05-23 00:10:23 +08:00

35 lines
1.2 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using System;
using UnityEngine;
namespace BaseGames.UI
{
/// <summary>
/// 按键图标服务接口。
/// 根据当前输入设备和玩家实际绑定(含改键),返回对应的按键 Sprite。
/// 通过 ServiceLocator 注册/查找,与 UI 层完全解耦。
/// </summary>
public interface IInputIconService
{
/// <summary>当前活跃输入设备类型。</summary>
InputDeviceType CurrentDevice { get; }
/// <summary>
/// 查询指定 Action如 "Interact")在当前设备上的按键图标。
/// 若找不到图标(资源未配置)返回 null。
/// </summary>
Sprite GetActionIcon(string actionName);
/// <summary>
/// 查询指定 Action 在当前设备上的有效绑定路径(含改键后的路径)。
/// 例如:"&lt;Keyboard&gt;/e"、"&lt;Gamepad&gt;/buttonSouth"。
/// </summary>
string GetActionEffectivePath(string actionName);
/// <summary>
/// 当设备切换或玩家改键后触发。
/// 订阅此事件的 UI 组件应在回调中刷新图标显示。
/// </summary>
event Action OnIconSetChanged;
}
}