private void CheckLongTap()
        {
            if (_listLongTap == null)
            {
                return;
            }

            Vector2 touchPos, diffPos;

            GetPosition(out touchPos, out diffPos);

            for (int i = 0, len = _listLongTap.Count; i < len; ++i)
            {
                GestureLongTap tap = _listLongTap[i];

                if (!tap.longTap && tap.enabled)
                {
                    if (tap.Check(diffPos, _time))
                    {
                        tap.longTap  = true;
                        tap.position = touchPos;

                        tap.callback();
                    }
                }
            }
        }
Beispiel #2
0
        public bool RemoveLongTap(GestureLongTap tap)
        {
            if (tap == null || _listLongTap == null)
            {
                return(false);
            }

            return(_listLongTap.Remove(tap));
        }
Beispiel #3
0
        public bool AddLongTap(GestureLongTap tap)
        {
            if (tap == null)
            {
                return(false);
            }

            if (_listLongTap == null)
            {
                _listLongTap = new List <GestureLongTap>();
            }

            _listLongTap.Add(tap);

            return(true);
        }