Unity UI Tutorial In C#

This Unity UI tutorial is based on the lessons in the beginner Unity3d course by Joshua Kinney (Link). You can get a free three-month full site trial to the course mentioned above by following the instructions on the home page.

Unity UI Tutorial

The UI in Unity and most games is used to display in-game information that the gamer needs to play the game effectively. An example of UI information would be something like how many lives a player has or how many hit points you have, etc.

Unity UI Setup

It is quite easy to set up the Unity UI. The first step is to create the canvas on top of which all the UI objects will display. UI objects can be affixed to the canvas and the are 10 of them. We will only be working with two of the UI objects in this example.
The first UI created is the text UI. The text UI is what it sounds like, and is used to display text on the HUD. The text is dynamic, so we will be changing it by adding a simple script to the text object. The second UI added in this lesson is the image object.

Unity UI Game Over

The end game is going to be a screen fader, so basically, we will add an UI image that will fade in once the game ends. The second UI will be some game over text object. Both the text and image will be animated when the game ends. There will be game over code added to the two game over UI objects. This script will be determining if the game has ended.

On a side note, the last lesson also adds audio.

Conclusion

I have now completed the course the beginner unity3d course by Joshua Kinney. The final Unity UI Tutorial was an exciting finish to this lesson as it effectively showed us how to end the game. I am now just completing my second course, the first being C# based and the second being this course. The next logical step is to move onto Blender as the third course. I am interested in creating my game assets, which will mainly be set up in Blender, especially if I can’t find any suitable once for free in the Unity A

Shares