ABSTRACT

The most basic form of debugging is achieved by the Debug. Log statement. In short, any Debug. Log statement prints out a string-based message to the Unity console window when executed at Run-Time. The two central drawbacks to using Debug. Log for debugging requires one to edit the source code itself and, second, it can spam the console confusingly when inside loops. In addition to MonoDevelop debugging, as well as debugging from the Unity Editor through the Object Inspector in Play-Mode, Unity also offers visual debugging. This refers to a range of methods available from the Gizmos class that can draw wireframe helpers on and around objects to assist in debugging. Each script in Unity is derived from MonoBehaviour, a crucial base class for creating components. It means all components handle a standard set of native events that Unity calls automatically, including Awake, OnEnable, and Update.