To complete our project, we will need to add two final components. These components will facilitate selecting an image for preview and providing visual feedback during the selection process.
Add the Graphic Raycaster component to the Preview objects. If you run the Scene, you will notice that our Swipe functions work as designed, but the user can not select a preview image for display. This is because our Preview thumbnail objects are looking for a Graphic Raycaster, but none is present; let's fix that:
- Select Preview (1) through Preview (5) in the first Gallery PreviewHolder.
- Click on Add Component in the Inspector window.
- Search for Graphic Raycaster and apply it to the selected GameObject.
- Repeat this process for each of the Gallery PreviewHolders.
- Hit click on the Play button to test the interaction. While the scene is running, click on the...