Skip to main content

Creating Gameplay UI and Animations

Operating System


Creating Gameplay UI

Create a UI Image by going in the menu clicking the GameObject , and UI then select Image. Rename the Canvas as Gameplay UI and set the component values as show in the image below.
tut21

After that rename the image as Background and locate it sprite in the Sprites folder.
tut22

After setting up the Background, we will create a prompt that will appear when the user is trying to quit the game. To do that creates another UI Image then rename it as Notification. And set its component values as show in the image.
tut23

After that create child object UI Text and set its component as show below.
tut24

Creating Animation

Notification Animation

First select the Notification then add an Animator Controller in the Inspector.

  1. Open the Animation Pane.
  2. Click Create New Clip name it as NotificationFade, and save it in the Animations folder.
  3. Set the Animation to 1 sec to 3 sec and set its component as show below.
    tut25
    tut26
  4. Click Play to animate the sprite.

Camera Animation

Now that we’re done with the Notification we will now animate the Camera similar on what we did on the Notification.

First select the Main Camera then add an Animator Controller in the Inspector:

  1. Open the Animation Pane.
  2. Click Create New Clip name it as CameraMovement, and save it in the Animations folder.
  3. Set the delay to 0.30 and also set the Camera size to 4.
    tut27
  4. Click Play to animate.
  5. Set Animator Controller to none because we will trigger it within the script.

Tags

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.

Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:

1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

Add new comment

CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.