// OVERRIDES: ------------------------------------------------------------------------------------------------------ protected override void OnEnded(TouchInfo touchInfo) { if (this.IsSwipe(touchInfo)) { if (this.broadcastOn9AxisSwipeANY != null) { this.broadcastOn9AxisSwipeANY(); } SimpleGesture.GestureDelegate method = this.GetDelegate(touchInfo); if (method != null) { method(); } SimpleGesture.GestureDelegate <GestureInfoSwipe> methodI = this.GetDelegateI(touchInfo); if (methodI != null) { Vector2 pos1 = touchInfo.GetFirstPosition(); Vector2 pos2 = touchInfo.GetLastPosition(); Vector2 direction = pos2 - pos1; float distance = direction.magnitude; GestureInfoSwipe gesture = new GestureInfoSwipe(direction, distance, pos1, pos2); methodI(gesture); } } }
protected override void OnMoved(TouchInfo touchInfo) { if (!this.hasFlickSwiped && this.IsSwipe(touchInfo)) { this.hasFlickSwiped = true; if (this.broadcastOn9AxisSwipeANY != null) { this.broadcastOn9AxisSwipeANY(); } if (this.broadcastOn9AxisSwipeANYI != null) { Vector2 pos1 = touchInfo.GetFirstPosition(); Vector2 pos2 = touchInfo.GetLastPosition(); Vector2 direction = pos2 - pos1; float distance = direction.magnitude; GestureInfoSwipe gesture = new GestureInfoSwipe(direction, distance, pos1, pos2); this.broadcastOn9AxisSwipeANYI(gesture); } SimpleGesture.GestureDelegate method9Axis = this.Get9AxisDelegate(touchInfo); if (method9Axis != null) { method9Axis(); } SimpleGesture.GestureDelegate method4Axis = this.Get4AxisDelegate(touchInfo); if (method4Axis != null) { method4Axis(); } SimpleGesture.GestureDelegate <GestureInfoSwipe> method9AxisI = this.Get9AxisDelegateI(touchInfo); if (method9AxisI != null) { Vector2 pos1 = touchInfo.GetFirstPosition(); Vector2 pos2 = touchInfo.GetLastPosition(); Vector2 direction = pos2 - pos1; float distance = direction.magnitude; GestureInfoSwipe gesture = new GestureInfoSwipe(direction, distance, pos1, pos2); method9AxisI(gesture); } SimpleGesture.GestureDelegate <GestureInfoSwipe> method4AxisI = this.Get4AxisDelegateI(touchInfo); if (method4AxisI != null) { Vector2 pos1 = touchInfo.GetFirstPosition(); Vector2 pos2 = touchInfo.GetLastPosition(); Vector2 direction = pos2 - pos1; float distance = direction.magnitude; GestureInfoSwipe gesture = new GestureInfoSwipe(direction, distance, pos1, pos2); method4AxisI(gesture); } } }