Game Development Reference
GUI.Box (Rect (160,42,35,35), yellowkey);
GUI.Box (Rect (160,42,35,35), greykey);
GUI.Box (Rect (200,42,35,35), greenkey);
GUI.Box (Rect (200,42,35,35), greykey);
Step 20. Attach this script to the Main Camera.
Step 21. Select the Main Camera in the Hierarchy and locate the
script in the Inspector. The script requires five images to be added
for the values of the colored keys. A file called Chapter Six/keys.zip
with the images for these can be downloaded from the Web site
or you can create your own. Place the key images in the Project
and drag each over to the Inspector to match the places in the
script as shown in Figure 6.9 . This script allows for an inventory of
FIG 6.9 Adding images for the keys
into the GUI.