I make a game under UWP, therefore input devices can be 3: a gamepad, a keyboard / mouse, a touch screen. Therefore, you need to make your prompts for each of these input types (press LS or press D), and when you touch the touchscreen, you also need to show a virtual gamepad, that is, you need an event that determines the current input device and performing actions based on this current input device. As I understand it, to implement this, you should always have an object with the InputController.cs script on the stage and interrogate the static class Input in it? But what is there to poll to find out the current input device? Or maybe Unity generally has an event or a delegate that is triggered by input from an input device that you can subscribe to in a static class and not have an extra object on the scene at all?
- ru.stackoverflow.com/a/570610/191482 - Alexey Shimansky
- @ Alexey Shimansky platform check will not work. Since any UWP device can have all input options at once. For example, tablets on Windows have a touch screen and usb into which you can plug in both a keyboard and a gamepad at the same time - Max Cat
|
1 answer
Here is http://herdo.imtqy.com/AdaptiveTriggerLibrary/ in the User Interaction Triggers collection there are 2 trigger InputTypeTrigger and InteractionMode Trigger
There you can set the behavior based on the input device. This is for normal UWP applications, but perhaps it can be used in your case.
- This method does not allow you to know that a gamepad is being used - Max Cat
|