public static void OnTap(GestureDelegate method) { if (GestureTap._instance == null) { GestureTap gestureTap = new GestureTap(); SimpleGesture.Instance.oneFingerGestures.Add(gestureTap); } GestureTap._instance.AddDelegate(method); }
private void Start() { const float longTapTime = 1.25f; const float flickRange = 100.0f; _tap = new GestureTap(() => { Debug.Log("Tap " + _tap.position.ToString()); }, time: longTapTime); _longTap = new GestureLongTap(() => { Debug.Log("LongTap " + _longTap.position.ToString()); }, time: longTapTime); _swipe = new GestureSwipe(() => { Debug.Log("Swipe " + _swipe.position.ToString()); }, threshold: flickRange); _flick = new GestureFlick(() => { Debug.Log("Flick " + _flick.position.ToString()); }, threshold: flickRange); }
public override void Delete() { GestureTap._instance = null; }
// CONSTRUCTOR: ---------------------------------------------------------------------------------------------------- public GestureTap() : base() { GestureTap._instance = this; }