/ Published in: C#

Simple touch detection in unity for mob devices
Expand |
Embed | Plain Text
using UnityEngine; using System.Collections; public class OnTouchDown : MonoBehaviour { foreach (Touch touch in Input.touches) { if (touch.phase == TouchPhase.Began) { // do staff when user just touch } else if (touch.phase == TouchPhase.Ended) { // do staff when user touch ended } } }
You need to login to post a comment.