Game Development Reference
In-Depth Information
Let' s discuss these crucial properties in more detail:
Total and Time ms : The Total column represents the proportion of frame
time consumed by the function. The value of 49.1% , for example, means that
49.1 percent of the total time required for the selected frame was consumed
by the function, including any time taken to call subfunctions (functions
called within the function). The Time ms column expresses the frame
consumption time in absolute terms, measured in milliseconds. Together,
these two values give you both a relative and absolute measure of how
expensive calling the function is on each frame and in total.
Self and Self ms : The Total and Total ms settings measure the expense of
the function for the selected frame, but they include the total time spent
inside other functions that were invoked from within the function. Both
Self and Self ms exclude this time and express only the total time spent
within the function, minus any additional time waiting for other functions
to complete. These values are often the most important when seeking to
pinpoint a specific function that causes performance problems.
More information on the Unity Profiler can be found at http://docs.unity3d.com/
Manual/ProfilerWindow.html .
Debugging with MonoDevelop - getting
started
Earlier, we encountered the Debug.Log method of debugging to print helper
messages to the console at critical moments in the code to help us see how the
program executes. This method, while functional, however, suffers some significant
drawbacks. First off, when writing larger programs with many Debug.Log
statements it's easy to effectively "spam" the console with excessive messages. This
makes it difficult to differentiate between the ones you need and the ones you don't.
Second, it's generally a bad practice to change your code by inserting the Debug.Log
statements simply to monitor program flow and find errors. Ideally, we should be
able to debug without changing our code. Therefore, we have compelling reasons to
find alternative ways to debug. MonoDevelop can help us here. Specifically, in the
latest releases of Unity, MonoDevelop can natively attach itself to a running Unity
process. In doing this, we get access to a range of common debugging tools, the kind
encountered when developing other types of software, such as breakpoints and
traces. Presently, the connectivity between MonoDevelop and Unity can be buggy
however, for some users on some systems. However, when working as intended,
MonoDevelop can offer a rich and useful debugging experience that allows us to
move beyond simply writing the Debug.Log statements.
 
Search WWH ::




Custom Search