Skip to Content
Mastering UI Development with Unity
book

Mastering UI Development with Unity

by Dr. Ashley Godbold
April 2018
Beginner content levelBeginner
468 pages
11h 7m
English
Packt Publishing
Content preview from Mastering UI Development with Unity

Multi-touch input

Touchscreen devices generally have the ability to access multiple touches. The most common usage of multi-touch allows the player to pinch to zoom. Accessing multi-touch is pretty easy. You access touches with Input.GetTouch(index), where the index represents the index of the touch, with the first touch occurring at index 0. From there, you can access information pretty much in the same way as accessing information about a mouse.

You can also find out how many total touches are occurring with Input.touchCount.

You can find an example of how to implement pinch-to-zoom functionality here: https://unity3d.com/learn/tutorials/topics/mobile-touch/pinch-zoom?playlist=17138.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Game Development with Unity for .NET Developers

Game Development with Unity for .NET Developers

Jiadong Chen
Unity UI Cookbook

Unity UI Cookbook

Francesco Sapio

Publisher Resources

ISBN: 9781787125520Supplemental Content