Accessing UI elements in code

All the UI elements can be accessed and manipulated in code similar to other GameObjects. To access a UI element in code, you must include the UnityEngine.UI namespace and the correct variable type.

Get Mastering UI Development with Unity 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.