How to do it...

To create a swipe transition effect, follow these steps:

  1. Open a scene.
  2. Create an Image in the Hierarchy. To do so, go to Game Object | UI | Image menu on the top of the screen.
  3. Image and Canvas game objects will be created in the Hierarchy.
  4. Select the Image game object and set its name to BlackScreen.
  5. Right-click on the Canvas game object and choose Create Empty to create an empty game object.
  6. Set the name of the newly created game object to FadeAnimator. This object will animate the effect.
  7. Set the Anchor Preset of the BlackScreen and FadeAnimator game objects to stretch in both X and Y coordinates the same way as we did in the previous recipe.
  8. Select the Canvas game object and add a Canvas Scaler component to it. We will ...

Get Unity 5.x Animation Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.