Game Development Reference
In-Depth Information
Summary
This chapter considered the process of debugging, which is centrally about finding
and removing errors from your game. There are many methods to achieve this end,
especially in Unity. Specifically, the methods considered here included the Debug.
Log statement, perhaps the simplest of all debugging methods. Using this technique,
Debug.Log statements are inserted into your code in critical lines, and these print
diagnostic messages to Unity's Console . Next, we looked at is custom defines:
using them, you can section off and isolate blocks of your code between the release
and debug versions; this allows you to run debug-specific code when specific flags
are enabled. Then, we looked at error logging. This chapter demonstrated how to
create an error logger class that integrates with native Unity's application class,
using delegates. We also saw the profiler; the Unity profiler is a pro-only feature
that gives us a high-level statistical insight into how processing is distributed over
time and system resources. In addition, we explored in-editor debugging and visual
debugging to gain a clearer visual insight into our scene, and factors that affect object
behavior. Finally, we saw MonoDevelop debugging, which does not require us to
edit our code. These include breakpoints, tracepoints, steps, and watches. Next up,
we'll explore how to work with GameObjects .
 
Search WWH ::




Custom Search