Creating the menu with the Unity GUI class and GUI skins
As we already have a working menu, rather than removing it from our scene, we will temporarily disable the objects that make it up.
Disabling game objects
One at a time, select the menu_playBtn, the menu_instructionsBtn, and the menu_quitBtn in the Hierarchy, and deactivate them by doing the following:
In the Inspector, uncheck the checkbox to the left-hand side of the name of the object at the top
Ensure that this has turned the text of the object to light gray in the Hierarchy and that the element itself has disappeared from the Game view preview—you should now be left with only the game title logo texture visible
Creating the menu
For this example, we'll be using Unity's GUI
class, and make use of a combination of public float
and Rect
values. A Rect
is a property that contains four floating point (decimal place) number values, two for the X and Y positions and two more for the Width and Height. We will use a Rect to define the area...