Beispiel #1
0
    public static void OnTap(GestureDelegate method)
    {
        if (GestureTap._instance == null)
        {
            GestureTap gestureTap = new GestureTap();
            SimpleGesture.Instance.oneFingerGestures.Add(gestureTap);
        }

        GestureTap._instance.AddDelegate(method);
    }
Beispiel #2
0
    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);
    }
Beispiel #3
0
 public override void Delete()
 {
     GestureTap._instance = null;
 }
Beispiel #4
0
    // CONSTRUCTOR: ----------------------------------------------------------------------------------------------------

    public GestureTap() : base()
    {
        GestureTap._instance = this;
    }