Book Image

Creating E-Learning Games with Unity

By : David Horachek
Book Image

Creating E-Learning Games with Unity

By: David Horachek

Overview of this book

Table of Contents (17 chapters)
Creating E-Learning Games with Unity
About the Author
About the Reviewers

Building the main menu pop up

Let's put all of this together and build a functional and extensible pop up for the main menu.

This pop up will display the name of the game on the title screen and present the user with three working buttons. From this, we will be able to make a pop-up Prefab that can be used for other UI. Perform the following steps to create a main menu pop up:

  1. To start, let's create the base of the panel. Create a plane that will be the base of the pop up. Set its position to 0, 0, 8.6 and its X rotation to -90.

  2. Scale the panel to 1.54, 1, 1 so that it is a bit wider than it is tall.

  3. On the MeshRenderer, we associate a new material called popupMaterial. This material has a white-colored component and a texture that is opaque gray with round edges with full alpha. Applying this material makes the plane appear rounded at the corners.

  4. Let's rename the plane to popup_MainMenu to reflect its actual role.

  5. The main menu pop up will have four child objects: a text field for the pop-up...