Skip to content

Instantly share code, notes, and snippets.

@AndreiPrystupchyk
AndreiPrystupchyk / SwipeInput.cs
Created February 18, 2021 08:48 — forked from Fonserbc/SwipeInput.cs
A simple swipe detector for touchscreens for Unity3D. Four cardinal directions.
using UnityEngine;
public class SwipeInput : MonoBehaviour {
public const float MAX_SWIPE_TIME = 1f;
public const float MIN_SWIPE_DISTANCE = 0.17f;
public static bool swipedRight = false;
public static bool swipedLeft = false;