Beispiel #1
0
 private void HandlePointerEvent(EPointerEvent evt)
 {
     if (evt == EPointerEvent.Click)
     {
         _onClick.Invoke();
     }
 }
        private void HandlePointerEvent(EPointerEvent pointerEvent)
        {
#if HEXDB
            if (Log != null)
            {
                Log.Invoke($"Hoverable on gameobject {gameObject} logged event {pointerEvent}");
            }
#endif

            switch (pointerEvent)
            {
            case EPointerEvent.Down:
                HoverableEvent.Invoke(EHoverableEvent.Down);
                break;

            case EPointerEvent.Enter:
                _isPointerOver = true;
                HoverableEvent.Invoke(EHoverableEvent.Hovering);
                break;

            case EPointerEvent.Exit:
                _isPointerOver = false;
                HoverableEvent.Invoke(EHoverableEvent.Absent);
                break;

            case EPointerEvent.Up:
                HoverableEvent.Invoke(_isPointerOver ? EHoverableEvent.Hovering : EHoverableEvent.Absent);
                break;
            }
        }
Beispiel #3
0
    public static void Trigger(EPointerEvent eventType, PointerEventData pointerData)
    {
        KPointerEvent e;

        if (events.TryGetValue(eventType, out e))
        {
            e.Trigger(pointerData);
        }
    }
Beispiel #4
0
    public static void RemoveListener(EPointerEvent eventType, PointerEventHandler listener)
    {
        KPointerEvent e;

        if (events.TryGetValue(eventType, out e))
        {
            e.RemoveListener(listener);
        }
    }
Beispiel #5
0
 private void HandlePointerEvent(EPointerEvent evt)
 {
     _lastEvent = evt;
 }