Screen Swipe
ScrollRect that snaps pages to screen size
com.brogan89.screenswipe 
Install via UPM
Add to Unity Package Manager using this URL
https://www.pkglnk.dev/screenswipe.git README Markdown
Copy this to your project's README.md
## Installation
Add **Screen Swipe** to your Unity project via Package Manager:
1. Open **Window > Package Manager**
2. Click **+** > **Add package from git URL**
3. Enter:
```
https://www.pkglnk.dev/screenswipe.git
```
[](https://www.pkglnk.dev/pkg/screenswipe)README
ScreenSwipe
ScrollRect that snaps pages to screen size
Install
OpenUPM
- Install with OpenUPM CLI
openupm add com.brogan89.screenswipe
UPM
In package manager window
Window > Package Managerclick + icon and choose "Add package from git URL...", then paste in the URLhttps://github.com/brogan89/ScreenSwipe.gitAlternatively add a dependency to your manifest.json in
./Packagesfolder.
"com.brogan89.screenswipe": "https://github.com/brogan89/ScreenSwipe.git"
Usage
- Right click in hierarchy choose UI > Screen Swipe > Screen Swipe.
- Then do the same for Pagination.
- Drag Pagination gameObject into Pagination field in the Screen Swipe inspector.
- Do the same for the buttons if you want.
- Add more pages if you want.
- Make sure pagination toggle count is the same as the number of pages you have.
- Press play, and check it out.
See the Demo scene for best implementation.
Notes
If you want a SrollRect as child of this script then use ScrollRectEx from Unity UI Extensions. It will pass the PointerData up the heirarchy in the OnDrag events. For some reason Unity's vanilla ScrollRect doesn't allow this.
References
This script used bits of code from and inspired by:
- Unity's ScrollRect.cs
- Unity-UI-Extensions HorizontalScrollSnap
No comments yet. Be the first!