I know, that with #if UNITY_WSA_10_0 I can execute specific code if this is UWP build, however my question is - how can I check what device it is, mainly XBOX, build running on PC or on Mobile ?
While it is nice that same build can work everywhere PC build require Exit button and mobile build require touch controls and not Xbox controller and it would be nice if my game can actually detect on what it is and work accordingly.
(tl;dr Skip to the bottom to for detecting tablet vs desktop.)
Well here’s the reason it’s hard. Microsoft is trying to remove the concept that mobile, desktop, and console are different things.
Microsoft does not feel UWP apps need an exit button. Users should not need to worry about the lifecycle of the app. The OS provides ways to close an app already.
Microsoft wants touch controls on both mobile, and desktop for those with touch screens. I wouldn’t be surprised if touchscreens are common with Xboxs in the future .
Xbox controllers can be attached to xboxs, desktops, and mobile platforms. Controllers should not be disabled only for mobile.
This is Microsoft’s style and what they would like in the future. I’m not saying MS is always right! f you still want to know if it is a touch interface or a mouse interface you can check:
if controller is not detected assume it is touch screen
** if it is touch screen and keyboard key is pressed switch to PC
** if in PC and tap/mouse click is detected switch to touch screen