public override void TouchesBegan(NSSet touches, UIEvent evt) { if (touches != null && evt != null) { base.TouchesBegan(touches, evt); } OnTouched?.Invoke(this, new OnTouchedEventArgs(this)); }
public bool OnTouch(View v, MotionEvent e) { var clipData = new ClipData("Label", new string[] { ClipDescription.MimetypeTextPlain }, new ClipData.Item("Label")); v.StartDragAndDrop(clipData, new View.DragShadowBuilder(v), null, 0); OnTouched?.Invoke(this, new OnTouchedEventArgs(v)); return(true); }
public bool TryTouch(IGrabbable grabbable) { if (!CanTouch(grabbable)) { return(false); } AddGrabbable(grabbable); OnTouched?.Invoke(this, grabbable); return(true); }
void Update() { #if UNITY_EDITOR if (Input.GetMouseButtonDown(0)) { _isTouched = true; _inputId++; _touchStartPosition = _mainCamera.ScreenToWorldPoint(Input.mousePosition); } if (Input.GetMouseButtonUp(0)) { _isTouched = false; } if (Input.GetMouseButton(0)) { _touchPosition = _mainCamera.ScreenToWorldPoint(Input.mousePosition); } #else if (_isTouched) { _isTouched = false; for (int i = 0; i < Input.touchCount; i++) { if (Input.GetTouch(i).fingerId == _touchId) { _activeTouch = Input.GetTouch(i); _isTouched = true; break; } } } if (!_isTouched) { if (Input.touchCount > 0) { _activeTouch = Input.GetTouch(0); _touchStartPosition = _mainCamera.ScreenToWorldPoint(_activeTouch.position); _touchId = _activeTouch.fingerId; _inputId++; _isTouched = true; } } #endif if (_isTouched) { #if !UNITY_EDITOR _touchPosition = _mainCamera.ScreenToWorldPoint(_activeTouch.position); #endif OnTouched?.Invoke(_inputId, _touchPosition); } }
public void RaiseOnTouched(OnTouchedEventArgs args) { OnTouched?.Invoke(this, args); }
public void Touched(IGrabber grabber) { OnTouched?.Invoke(grabber, this); }