O'Reilly logo

Unity 3 Game Development HOTSHOT by Jate Wittayabundit

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating the rocket bullet UI

Here we are at the last section of this chapter. As we know from the last step, we need a way to show the number of rockets left on the screen. In this step, we will create the rocket UI, which will show the number of rockets left and the rocket graphics. We will use both GUITexture and OnGUI() to create the UI.

Engage Thrusters

This is the last section, which will create the RocketUI script to display the remaining rocket bullets on the screen:

  1. Go to Assets | Create | Javascript and name it RocketUI. Then, double-click on it to open MonoDevelop and replace the script as follows:
    public var rocketLauncher : RocketLauncher; public var customSkin : GUISkin; public var width : float = 80; public var height : float = 25; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required