I have a variation of my UI that I enable for handheld devices like the Switch and the Steam Deck (larger font sizes, etc).
I understand that you can use Steamworks to detect the Steam Deck, like SteamUtils.IsSteamRunningOnSteamDeck(). But, is there a more generic way for Unity to detect a handheld gaming device? And if not, do you think SystemInfo.deviceName would return “ROG Ally” or something like that? Unfortunately I don’t have one to test it myself (I might be able to ask someone to test it, though).
To be honest, don’t bother to develop for devices, which you or your team doesn’t have on hand. You will need to build and test frequently, while resolving bugs. Also you need be able to collect any crash logs.
Asking some friend to test occasionally is not viable for production.
So either get the device you are making game for, or drop the support.
Windows has a systeminfo command that can provide hardware info. For example this is what it says about my workstation (there are more details but this is the system section):
System Manufacturer: Gigabyte Technology Co., Ltd.
System Model: B550 AORUS MASTER
System Type: x64-based PC
Processor(s): 1 Processor(s) Installed.
[01]: AMD64 Family 25 Model 33 Stepping 0 AuthenticAMD ~3401 Mhz
I don’t know the actual values that belong to the ROG Ally, and like @Antypodish said I wouldn’t try to support it without the actual device to verify everything does in fact work as it’s not at all guaranteed just because it works on other devices.
There’s a difference between “lazy” and “making things harder on yourself” that you missed. The reason you shouldn’t do this sort of thing is that it will make later debug processes more difficult if something happens on a single platform but not others. All of a sudden you’re dealing with vague shots in the dark because you have a conditional based on something you don’t own.
I’m typically the programmer responsible for platform support with my contracts so it’s actual experience from having to deal with these platforms and not just an arbitrary rule made up to save time. It’s just wasting time hacking in support for a device you can’t troubleshoot. I don’t care if it seems easy. It’s almost never the case.
I like the idea of a slider to change the scale of the UI. It has the added bonus of doubling as an accessibility option.
Just ran this from a Linux build on a Steam Deck OLED with no Steamworks. Some of these returns are not strings, but they print this way via .ToString().