O'Reilly logo

Unity 3D Game Development by Example by Ryan Henson Creighton

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

Time for action - prepare the GUI

In Unity, GUIs are coded in scripts, which are attached to game objects. Let's create an empty GameObject and then attach a new script to it.

  1. Click on GameObject | Create Empty. A GameObject called "GameObject" appears in the Hierarchy panel.
  2. Click on the GameObject in the Hierarchy panel and press F2. Rename it as TitleScreen.
  3. Right-click on a blank space in the Project panel and select Create | JavaScript.
  4. Rename the new script TitleGUI.
  5. Click-and-drag the TitleGUI script from the Project panel to the TitleScreen Game Object you just created in the Hierarchy panel. The TitleScreen Game Object should light up blue before you release the mouse button.
  6. To make sure the TitleGUI script is linked to the TitleScreen ...

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