public void OnPointerUp(PointerEventData data) { if (!isDragging) { return; } if (data.pointerId != touchId) { return; } isDragging = false; touchId = -1; movementController.position = defaultControllerPosition; if (movementBackground != null) { movementBackground.position = backgroundOffset + movementController.position; } if (useAxisX) { RPGInputManager.SetAxis(axisXName, 0); } if (useAxisY) { RPGInputManager.SetAxis(axisYName, 0); } }
public void UpdateVirtualAxes(Vector3 value) { value = value.normalized; if (useAxisX) { RPGInputManager.SetAxis(axisXName, value.x); } if (useAxisY) { RPGInputManager.SetAxis(axisYName, value.y); } }
private void UpdateVirtualAxes(Vector3 value) { var delta = startDragPosition - value; delta.y = -delta.y; delta /= movementRange; if (useAxisX) { RPGInputManager.SetAxis(axisXName, -delta.x); } if (useAxisY) { RPGInputManager.SetAxis(axisYName, delta.y); } }