O'Reilly logo

Unity for Architectural Visualization by Stefan Boeykens

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

Basic heads-up-display with a custom GUI

When we explained the use of GUIText and GUITexture components in Chapter 4, Promenade Architecturale, they were static. This is fine for a fixed logo, but not when you need dynamic information. You can script these components, but they are not the most efficient ones to use. This is shown in the following code:

public Texture2D someTexture;
...
guiText.text = "Hello";
guiTexture.texture = someTexture;

An alternative is the use of the Unity Graphical User Interface (GUI) classes. To display a GUI inside a script in Unity, use the OnGUI() event. This runs independently of the regular Update() cycle. Inside this event, you can display buttons, text labels, sliders, panels, scroll areas, textures, and toggle ...

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