IsTouchType check doesn't seem correct for Windows
6 years 9 months ago #2815
by studenman
IsTouchType check doesn't seem correct for Windows was created by studenman
I was looking at the TermData.IsTouchType() method, and I noticed that it doesn't consider laptops like the Microsoft Surface a touch device. These systems would report TRUE for Input.touchSupported. The documentation for this API recommends using this instead of checking the platform target. Perhaps in the editor, though, a check for the mobile device #defines would make sense. Here's my suggested modification:
public static bool IsTouchType()
{
#if UNITY_EDITOR && (UNITY_ANDROID || UNITY_IOS || UNITY_WP8)
return true;
#else
return Input.touchSupported;
#endif
}
Please Log in or Create an account to join the conversation.
6 years 9 months ago #2816
by Frank
Are you Give I2L 5 stars!
Are you Please lets us know how to improve it!
Replied by Frank on topic IsTouchType check doesn't seem correct for Windows
Hi,
Initially I thought on doing something similar. However, the issue is that devices like the Surface support Touch, but also have a keyboard, so, it can be either "Normal" or "Touch" depending on your game.
That's why I have been filtering by platform, and then recommending modifying that function to the way it makes more sense to your game.
Said that, how this system works is going to change in the next release. I'm currently implementing trello.com/c/slJ2P9aM/3-extend-input-specialization
Which allows you setting your own Specializations (not just for input, it can be anything e.g. Steam, Oculus, Vive, etc). As part of that, you have a way to detect and decide what Specialization is enabled based on your game conditions.
I will be giving more details as soon as I have the first beta of that ready.
Hope that helps,
Frank
Initially I thought on doing something similar. However, the issue is that devices like the Surface support Touch, but also have a keyboard, so, it can be either "Normal" or "Touch" depending on your game.
That's why I have been filtering by platform, and then recommending modifying that function to the way it makes more sense to your game.
Said that, how this system works is going to change in the next release. I'm currently implementing trello.com/c/slJ2P9aM/3-extend-input-specialization
Which allows you setting your own Specializations (not just for input, it can be anything e.g. Steam, Oculus, Vive, etc). As part of that, you have a way to detect and decide what Specialization is enabled based on your game conditions.
I will be giving more details as soon as I have the first beta of that ready.
Hope that helps,
Frank
Are you Give I2L 5 stars!
Are you Please lets us know how to improve it!
To get the betas as soon as they are ready,
check this out
The following user(s) said Thank You: studenman
Please Log in or Create an account to join the conversation.
6 years 9 months ago - 6 years 9 months ago #2817
by studenman
Replied by studenman on topic IsTouchType check doesn't seem correct for Windows
You have my up-vote on custom specializations. Would be nice to be able to disable or remove the ones we don't use, for example Xbox, to reduce GUI clutter.
Last edit: 6 years 9 months ago by studenman.
Please Log in or Create an account to join the conversation.
6 years 9 months ago #2818
by Frank
Are you Give I2L 5 stars!
Are you Please lets us know how to improve it!
Replied by Frank on topic IsTouchType check doesn't seem correct for Windows
Yes, its all configurable, you select the list of specializations you want and can easily override when they are selected. Also, there is no need to change the plugin code, its really easy to plug the changes.
Are you Give I2L 5 stars!
Are you Please lets us know how to improve it!
To get the betas as soon as they are ready,
check this out
The following user(s) said Thank You: studenman
Please Log in or Create an account to join the conversation.
Time to create page: 0.160 seconds