public void PointerUp(TouchInputEvent touchEvent) { if (touchEvent.primaryActionIndex > 1) { return; } lastPointer[touchEvent.primaryActionIndex] = Vector2.zero; if (rotating) { int numTouches = touchEvent.pointerEvents.Count; bool isRotating = UpdateRotation(touchEvent, numTouches, true); if (!isRotating) { //Wrld_TTY("ROTATE STOP\n"); needNewBaseline = true; AppInterface.RotateData rot = PopulateRotateData(numTouches, 0.0f); rotating = false; m_previousRotationDelta = 0.0f; m_totalRotation = 0.0f; m_handler.Event_TouchRotate_End(rot); } } }
private static AppInterface.RotateData PopulateRotateData(int numTouches, float rotationRadians) { AppInterface.RotateData result = new AppInterface.RotateData(); result.numTouches = numTouches; result.rotation = rotationRadians; result.velocity = 0.0f; // not implemented return(result); }
public void PointerMove(TouchInputEvent touchEvent) { if (touchEvent.primaryActionIndex > 1) { return; } if (rotating) { int numTouches = touchEvent.pointerEvents.Count; bool isRotating = UpdateRotation(touchEvent, numTouches, false); if (isRotating) { AppInterface.RotateData rot = PopulateRotateData(numTouches, m_totalRotation); m_handler.Event_TouchRotate(rot); } } }