Game Development Reference
In-Depth Information
Congratulations! We now have a working
NEW
button that starts a new game by
loading a new level and destroying the menu pop up. At this point, we can delete the
previous main menu page.
Let's continue building out the
MainMenu
Prefab:
1. Duplicate the
NEW
button twice, and translate the two copies below the first
one to (
0
,
0.1
,
-1.5
) and (
0
,
0.1
,
-3
).
2. Rename the second button to
Button2
and set the name of the text field to
Info
. Rename the third button to
Button3
and set the name of the text field
to
QUIT
.
3. Open the
popupButtonScript
on the third button, and change the
On
and
Off
textures to light and dark red textures, respectively. Change the number
of actions in the script to
1
and set the action to
QuitApplication
.
4. Open the
popupButtonScript
on the second button and change two ac-
tions. The first one should be
Instantiate
, where
obj
is the
popup_Info
Prefab, and the parent object's name is codified under the name field
MainCamera
.