Unity Touchinput by jocic - 2

Inputs

Touch gestures made easy for Unity3D Game Engine.

Unknown VersionMIT LicenseUpdated 3 years agoCreated on July 1st, 2015
Go to source

Unity Touch Input

Touch gestures made easy for Unity3D Game Engine.

Example

After adding the script “TouchInput.cs” to your project you can start using it immediately.

    using UnityEngine;
    using System.Collections;

    public class BasicController : MonoBehaviour
    {	
	    void Start()
	    {
	
	    }

	    void Update()
	    {
		    TouchInput.ProcessTouches();

		    if (TouchInput.Tap())
		    {
			    // TAP DETECTED
		    }
		    else if (TouchInput.SwipeUp())
		    {
			    // SWIPE UP DETECTED
		    }
		    else if (TouchInput.SwipeDown())
		    {
			    // SWIPE DOWN DETECTED
		    }
		    else if (TouchInput.SwipeLeft())
		    {
			    // SWIPE LEFT DETECTED
		    }
		    else if (TouchInput.SwipeRight())
		    {
			    // SWIPE RIGHT DETECTED
		    }
	    }
    }
Show all projects by jocic