Game Development Reference
In-Depth Information
Great! Now, we have three functional buttons on our pop up. When we move over
them, the PopupButton script swaps the highlighted and non-highlighted textures
for an additional visual cue.
1. Drag-and-drop this pop up into the Project tab to make a Prefab out of it.
Name the Prefab popup_MainMenu . We will need to reinstance our main
menu from the Prefab at a later time.
2. Let's create a new Prefab based on this one. It will be used for the Informa-
tion tab. To begin, copy and paste the popup_MainMenu Prefab. Rename it
popup_Info .
3. Keeping the dimensions the same, rename the panel to Info by changing
the pop-up name parameter in the popupPanel script.
4. Delete button 2 and button 3 from the popup_Info object; we only need
one button on this panel to return to the main menu. Open the popupBut-
tonScript on the single button and ensure that there are two valid actions.
5. Set the first action to Instantiate . In the data member for that action, set
the Obj to instantiate to a reference to the popup_MainMenu Prefab. This
will tell the button to create a copy of the popup_MainMenu Prefab when
the button is clicked. To tell the script which GameObject to parent this new
instance to, add the name of the object to the Name field and change the
name field to MainCamera .
Search WWH ::




Custom Search