Step/Iterative Debugging

I’m sure the answer is out there somewhere, but I’m not sure if I’m using the right terminology.

I’m creating a procedurally generated map. Vertices are being added to the map iteratively. It mostly works, but there are a few vertices that seem to be completely off. So I want to look at the map as it evolves, with each iteration, and pin down which steps are causing the issue and why.

I’m using the “Debug.DrawLine” function, but it just pumps lines out and leaves them there. It leaves me with the end product, rather than the intermediate steps.

I want to draw the lines between vertices = n, then freeze or delay… then clear the whole screen and draw the lines between vertices = n + 1. And go through each iteration one by one to see where it goes off the rails.

I have no clue how to do this. And I’m looking for a quick way to get there, with as little additional coding as possible.

Any guidance or useful links are appreciated.

=======

Thanks everyone. I ended up just counting the iterations, and setting the program to quit at various numbers. Had to run it over and over, and it was tedious. But I figured it out.

Why not just attach MonoDevelop to the Unity process and set a breakpoint from which to step through the code?
http://docs.unity3d.com/432/Documentation/Manual/Debugger.html