But you're desperate, or perhaps maybe you're just the curious sort. Either way, your questions would be answered if you could just tell what the heck was going on inside that Unity function. You're wondering how to get Visual Studio to let you debug code within Unity's core libraries themselves.

That's precisely what we're going to do.

This isn't for the faint of heart — we'll be decompiling, recompiling, and patching Unity assemblies. However, after you've done it once, it's not quite as tricky as it sounds. With this under our belts it can make debugging complex Unity systems (like UnityEngine.UI) a breeze.

When we're done, we'll be able to step through code inside of the Unity Engine, set breakpoints, and even inspect local and static variables of the editor itself! As always, if you have questions or comments, drop me a line on twitter and I'll do my best to help out.