예제 #1
0
 public void OnDrag(PointerEventData eventData) {
     var position = this.getPointPosition(eventData);
     this._windowAdapter.postPointerEvent(new PointerData(
         timeStamp: Timer.timespanSinceStartup,
         change: PointerChange.move,
         kind: InputUtils.getPointerDeviceKind(eventData),
         device: InputUtils.getPointerDeviceKey(eventData),
         physicalX: position.x,
         physicalY: position.y
     ));
 }
예제 #2
0
 public void OnPointerDown(PointerEventData eventData) {
     EventSystem.current.SetSelectedGameObject(this.gameObject, eventData);
     var position = this.getPointPosition(eventData);
     this._windowAdapter.postPointerEvent(new PointerData(
         timeStamp: Timer.timespanSinceStartup,
         change: PointerChange.down,
         kind: InputUtils.getPointerDeviceKind(eventData),
         device: InputUtils.getPointerDeviceKey(eventData),
         physicalX: position.x,
         physicalY: position.y
     ));
 }
예제 #3
0
        public void OnPointerExit(PointerEventData eventData)
        {
            this._mouseEntered = false;
            var position = this.getPointPosition(eventData);

            this._windowAdapter.postPointerEvent(new PointerData(
                                                     timeStamp: Timer.timespanSinceStartup,
                                                     change: PointerChange.hover,
                                                     kind: InputUtils.getPointerDeviceKind(),
                                                     device: InputUtils.getPointerDeviceKey(eventData),
                                                     physicalX: position.x,
                                                     physicalY: position.y
                                                     ));
        }
예제 #4
0
        public void OnPointerExit(PointerEventData eventData) {
            var pointerKey = InputUtils.getPointerDeviceKey(eventData);
            this._enteredPointers.Remove(pointerKey);

            var position = this.getPointPosition(eventData);
            this._windowAdapter.postPointerEvent(new PointerData(
                timeStamp: Timer.timespanSinceStartup,
                change: PointerChange.hover,
                kind: InputUtils.getPointerDeviceKind(eventData),
                device: pointerKey,
                physicalX: position.x,
                physicalY: position.y
            ));
        }
예제 #5
0
        public void OnPointerUp(PointerEventData eventData)
        {
            var position = this.getPointPosition(eventData);

            if (position == null)
            {
                return;
            }
            this._windowAdapter.postPointerEvent(new PointerData(
                                                     timeStamp: Timer.timespanSinceStartup,
                                                     change: PointerChange.up,
                                                     kind: InputUtils.getPointerDeviceKind(eventData),
                                                     device: InputUtils.getPointerDeviceKey(eventData),
                                                     physicalX: position.Value.x,
                                                     physicalY: position.Value.y
                                                     ));
        }
예제 #6
0
        public void OnPointerEnter(PointerEventData eventData)
        {
            var position = this.getPointPosition(eventData);

            if (position == null)
            {
                return;
            }
            var pointerKey = InputUtils.getPointerDeviceKey(eventData);

            this._enteredPointers.Add(pointerKey);

            this._lastMouseMove = eventData.position;
            this._windowAdapter.postPointerEvent(new PointerData(
                                                     timeStamp: Timer.timespanSinceStartup,
                                                     change: PointerChange.hover,
                                                     kind: InputUtils.getPointerDeviceKind(eventData),
                                                     device: pointerKey,
                                                     physicalX: position.Value.x,
                                                     physicalY: position.Value.y
                                                     ));
        }