Book Image

Unity3D UI Essentials

By : Simon Jackson
Book Image

Unity3D UI Essentials

By: Simon Jackson

Overview of this book

<p>Unity is a powerful cross-platform development engine that provides rich framework to create 2D and 3D apps or games. Through Unity3D, users are able take master the complexities of game development with ease, including animations, physics, renderings, shaders, scripting and now, Unity have released a new and advanced system to cope with the UI demands for modern applications and games.</p> <p>Unity 3D UI Essentials is a complete walk-through of the new UI system in Unity V4 and beyond (including Unity 5). This fast-paced practical tutorial provides you with in depth details of the new UI controls and layouts that can be used to create stunning and multiresolution UI.</p> <p>Venture forth into the highly componentized and advanced UI system, covering new features such as responsive designs and layouts. Also you get to deep-dive into the scripting side of the UI system as Unity has made the entire framework open source, giving free access to the source code of the new UI system to all developers.</p> <p>So get ready for a wild ride into the new Unity3D UI system and set your course for awesome!</p>
Table of Contents (14 chapters)

Don't push this button


As we venture into the interactive realm, we tackle the first of the combined controls, the Button control/component. In fact, the Button control is not a single entity but a combination of several different components under one banner. The Button is more of an example of what can be achieved by building/combining controls to do what you want more than anything else.

Like with the previous controls, you can add the Button from the menu or through the project Hierarchy, or using the component options (Create | UI | Button). When you add a Button control, what you actually get is the following:

  • An Image control

  • A button script that implements:

    • The Selectable control (covered later)

    • Several Trigger events

  • A Text control (as a child)

A fairly well-built stack that draws in all the features it needs. In fact, let's look at the Button control in code:

Note

Note: This is taken directly from the UI source as an example. If you add this in a project it will cause an error because there...