public void moveBallistic(float motion) { pointCurrentY = lastDragY + motion; lastDragY = pointCurrentY; if (activeChapter == 1 && pointCurrentY < pointStartY) { UIChapterPanel.AdjustPanels(((pointCurrentY - pointStartY) / endPanelDragFriction) / Screen.height); } else if (activeChapter == 4 && pointCurrentY > pointStartY) { UIChapterPanel.AdjustPanels(((pointCurrentY - pointStartY) / endPanelDragFriction) / Screen.height); } else { UIChapterPanel.AdjustPanels(((pointCurrentY - pointStartY) / dragFriction) / Screen.height); } }
public void OnDrag(PointerEventData eventData) { pointCurrentY = eventData.position.y; UIChapterPanel.drag = true; momentum = Mathf.Clamp((momentum + (pointCurrentY - lastDragY)) / 2, -maxMomentum, maxMomentum); startmomentum = momentum; lastDragY = pointCurrentY; if (activeChapter == 1 && pointCurrentY < pointStartY) { UIChapterPanel.AdjustPanels(((pointCurrentY - pointStartY) / endPanelDragFriction) / Screen.height); } else if (activeChapter == 4 && pointCurrentY > pointStartY) { UIChapterPanel.AdjustPanels(((pointCurrentY - pointStartY) / endPanelDragFriction) / Screen.height); } else { UIChapterPanel.AdjustPanels(((pointCurrentY - pointStartY) / dragFriction) / Screen.height); } }