34 lines
742 B
C#
34 lines
742 B
C#
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;
|
|
}
|
|
}
|
|
}
|
|
|