Game Development Reference
In-Depth Information
In this funcion, irst we set the maximum of our items in this container, and next we
create a
GUI.Box
for the background of the item scroll area. Then, we create the
scroll by using
GUI.BeginScrollView
. Next, we create a
GUIContent
array to
contain our items, create
GUI.SelectionGrid
, and apply our
GUIContent
array
to show them. Then, we get the item informaion from the
GUIContent.tooltip
,
calculate the height of that informaion, and put it in the
Label
, which is also a
scroll view.
5. Now, go back to Unity and click on the
Menu
object in the
Hierarchy
view to bring
up its
inspector
. Then, click on the
A_items
opion to bring up the drop-down and
assign the parameters as follows:
Size
:
1
Element 0
F
Icon
:
key.png
(located in
Chapter2/images
folder)
F
Name
:
Key
Amount
:
1
Now, click
play
, and press the
M
key to bring up our menu window. Click on the
INVENTORY
tab and we will see our item page. Isn't that cool?