Return to Snippet

Revision: 59367
at September 4, 2012 08:21 by jquery404


Initial Code
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
		}
	}

}

Initial URL

                                

Initial Description
Simple touch detection in unity for mob devices

Initial Title
Simple Touch Input

Initial Tags
mobile, android

Initial Language
C#