Game Development Reference
In-Depth Information
6. Set the second action to
SelfDestruct
so that this button will delete itself
on a click.
7. In the
popup_Info
object, add five more
TextMesh
GameObject instances.
Put them on successive lines at a distance of
0.8
units in z from one another.
These will be used to store the lines of text in your information pop up. Set
the first three lines of text to the following:
Geography Quest © 2014
PACKT Publishing
all rights reserved
8. Save this Prefab to the project folder by dragging-and-dropping it into your
assets folder. Name the new Prefab
popup_Info
.
9. Go back to your
popup_MainMenu
and open up the button 2
popupBut-
tonScript
component. Find the
Instantiate
command in the actions ar-
ray for this button. Now, go to the
Data
field for this action, and change the
obj
reference to the Prefab
popup_Info
by dragging-and-dropping it from
the
Project
tab back to this field. Also, make sure the name of the parent ob-
ject is also set at this time to
MainCamera
.
Congratulations! We now have a working information screen pop-up that has been
connected to the
Info
button of our working main menu pop up. If you have not
already done so, please delete the previous main menu panel from the last chapter;