Unity3D breakpoint debugging features
Breakpoint debugging function can be described as an essential function of the programmer. Unity3D supports js and c # to write the script, but many people may not know, in fact, Unity3D can breakpoint debugging of a program. But this breakpoint debugging functionality is limited using Unity3D own MonoDevelop editor. The use Visual Studio is not enough. I heard a man named UnityVS things you can use VS for Unity breakpoint Debug, but I myself have not tried Ah Zhao.
Well, simply talk about the practice of it:
First is to make sure the script editor is designated as the MonoDevelop.
After selecting, you can select Sync MonoDevelop Project in the Project panel, right to open MonoDevelop.
Because of the need to have a script to debug script, so I wrote a very simple script, there are two buttons, press the first "add" button, the program will use a cyclic fashion from 0-9 of the add up the number, then add up the sum. When you press the second button, it will sum to zero.
After the written script, the script just drag scene objects above, we are ready to debug. Prior to commissioning, we need to MonoDevelop and Unity3D to connect.
The specific method of connecting two kinds:
First, put the current scene to save it, and then turn off the Unity. Back MonoDevelop, press F5 or click the Debug button.
In this way, MonoDevelop will open a new interface Unity3D, this time the connection is complete.
At this time, MonoDevelop will now contact the Unity.
Once connected the Unity3D, debug button on the right becomes available, we choose the window display Debug.
Use the debug button, let the program run single step
We see the actual changes in the current variable i and the sum of.
Here, breakpoint debugging has been completed.
After commissioning finished, I suggest that it is best to disconnect the MonoDevelop and Unity3D. If you continue to open the case, Unity would have been very slow in the state.
Or we could just put additional process Detach off.
Or, we can click this button plug, disconnect the Debugger.