April 2018
Beginner
468 pages
11h 7m
English
A namespace is a collection of classes. When you include a namespace in your class, you are stating that you want to access all the variables and methods (functions) in your class. Namespaces are accessed at the top of a script with the using keyword.
By default, all new C# scripts include the System.Collections, System.Collections.Generic, and UnityEngine namespaces. To access the properties of UI elements via code, you must first use the UnityEngine.UI namespace.
Therefore, at the top of your C# script, you will need to include the following line to signify that you want to use the UnityEngine.UI namespace:
using UnityEngine.UI;
Without using the namespace, any variable type related to UI elements will be colored ...