public bool IsTouchReferenceEqualsCurrentTouch(CameraInputController.MouseOrTouch p_currentTouch) { if (p_currentTouch != null && _touchReference != null && ( (p_currentTouch == _touchReference) || (p_currentTouch.current == _touchReference.current) || (p_currentTouch.pressed == _touchReference.pressed) || (p_currentTouch.dragged == _touchReference.dragged) ) ) { return(true); } return(false); }
protected virtual void ResetToNonPressingState(bool p_forceDeativateColliders = false) { if (CameraThatDrawThisObject != null && TrailComponent != null) { _grabbing = false; _touchReference = null; Cutting = false; TrailComponent.time = 0; //TrailComponent.ignoreTimeScale = IgnoreTimeScale; _currentDeltaTime = _maxDeltaTime; _oldPosition = this.transform.position; if (p_forceDeativateColliders && gameObject.GetComponent <Collider2D>() != null) { gameObject.GetComponent <Collider2D>().enabled = Cutting; } } }
//Only works when grabing touch inside HandleGlobalPress protected virtual void GrabTouch() { if (!_grabbing && CameraInputController.currentTouch != null) { if (!OnlyShowWhenGrabTouch || CameraInputController.currentTouch.current == null) { //if (!OnlyShowWhenGrabTouch) // return; _grabbing = true; _touchReference = CameraInputController.currentTouch; if (CameraInputController.currentTouch.current == null) { CameraInputController.currentTouch.current = this.gameObject; CameraInputController.currentTouch.pressed = this.gameObject; CameraInputController.currentTouch.dragged = this.gameObject; } UpdateTrail(true); } } }