Exemple #1
0
 public void OnPointerDown(PointerEventData eventData)
 {
     timePressStarted   = Time.time;
     longPressStartTime = Time.time;
     isPointerDown      = true;
     longPressTriggered = false;
     onPointDown?.Invoke(eventData);
 }
Exemple #2
0
        public void OnPointerClick(PointerEventData eventData)
        {
            if (!longPressTriggered)
            {
                onClick?.Invoke(eventData);
            }
// EventSystem.current.RaycastAll(new PointerEventData(EventSystem.current), );
            // PointerEventData p = new PointerEventData(EventSystem.current);
        }
Exemple #3
0
        private void Update()
        {
            if (isPointerDown && !longPressTriggered)
            {
                if (Time.time - timePressStarted > durationThreshold)
                {
                    longPressTriggered = true;
                    onLongPress?.Invoke(null);
                }
            }

            if (isPointerDown)
            {
                if (Time.time - longPressStartTime > longPressInterval)
                {
                    longPressStartTime = Time.time;
                    onLongPressInterval?.Invoke(null);
                }
            }
        }
Exemple #4
0
 public void OnPointerUp(PointerEventData eventData)
 {
     isPointerDown = false;
     onPointUp?.Invoke(eventData);
 }
Exemple #5
0
 public void OnPointerEnter(PointerEventData eventData)
 {
     onPointerEnter?.Invoke(eventData);
 }
Exemple #6
0
 public void OnPointerExit(PointerEventData eventData)
 {
     onPointerExit?.Invoke(eventData);
 }
 public void OnEndDrag(PointerEventData eventData)
 {
     onEndDrag?.Invoke(eventData);
 }
 public void OnBeginDrag(PointerEventData eventData)
 {
     onBeginDrag?.Invoke(eventData);
 }
 public void OnDrag(PointerEventData eventData)
 {
     Debug.Log("OnDrag:" + eventData.position.ToString());
     onDrag?.Invoke(eventData);
 }
Exemple #10
0
 public void OnPointerUp(PointerEventData eventData)
 {
     onPressUp?.Invoke(eventData);
 }
Exemple #11
0
 public void OnPointerDown(PointerEventData eventData)
 {
     onPressDown?.Invoke(eventData);
 }