11

Menus and User Interface

In this chapter, first up is a full breakdown of the main menu used for all of the example games. The main menu structure should provide a perfect starting place for any main menu system.

The second part of this chapter will look at in-game UI.

11.1CanvasManager Class/Canvas Management

CanvasManager is a class devoted to switching between user interface Canvases, for example when you want to move from a main menu to a sub menu such as an options menu. It relies on a Component called CanvasGroup, which is provided by Unity as part of the engine. CanvasGroup lets us set an alpha transparency level of an entire Canvas as well as providing methods to enable or disable interactivity or enable or disable blocking ...

Get C# Game Programming Cookbook for Unity 3D, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.