清理项目目录,引入 InputModule 做多平台输入适配
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
namespace SepCore.InputModule.Runtime
|
||||
{
|
||||
internal static class InputDeviceKindUtility
|
||||
{
|
||||
public static InputDeviceKind FromDevice(InputDevice device)
|
||||
{
|
||||
if (device == null)
|
||||
{
|
||||
return InputDeviceKind.Unknown;
|
||||
}
|
||||
|
||||
if (device is Gamepad)
|
||||
{
|
||||
return InputDeviceKind.Gamepad;
|
||||
}
|
||||
|
||||
if (device is Touchscreen)
|
||||
{
|
||||
return InputDeviceKind.Touch;
|
||||
}
|
||||
|
||||
if (device is Keyboard || device is Mouse)
|
||||
{
|
||||
return InputDeviceKind.KeyboardMouse;
|
||||
}
|
||||
|
||||
return InputDeviceKind.Unknown;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user