Welcome, Guest
Username: Password: Remember me

TOPIC: IsTouchType check doesn't seem correct for Windows

IsTouchType check doesn't seem correct for Windows 9 months 1 week ago #2815

  • studenman
  • studenman's Avatar
  • Offline
  • Senior Member
  • Posts: 62
  • Thank you received: 1
  • Karma: 1
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
	}
Follow Tiny Bubbles Development:
Twitter | Facebook | Web
The administrator has disabled public write access.

IsTouchType check doesn't seem correct for Windows 9 months 1 week ago #2816

  • Frank
  • Frank's Avatar
  • Offline
  • Administrator
  • Posts: 1149
  • Thank you received: 248
  • Karma: 75
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
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 administrator has disabled public write access.
The following user(s) said Thank You: studenman

IsTouchType check doesn't seem correct for Windows 9 months 1 week ago #2817

  • studenman
  • studenman's Avatar
  • Offline
  • Senior Member
  • Posts: 62
  • Thank you received: 1
  • Karma: 1
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.
Follow Tiny Bubbles Development:
Twitter | Facebook | Web
Last Edit: 9 months 1 week ago by studenman.
The administrator has disabled public write access.

IsTouchType check doesn't seem correct for Windows 9 months 1 week ago #2818

  • Frank
  • Frank's Avatar
  • Offline
  • Administrator
  • Posts: 1149
  • Thank you received: 248
  • Karma: 75
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 administrator has disabled public write access.
The following user(s) said Thank You: studenman
Time to create page: 0.094 seconds
Template by JoomlaShine