Tip of the Week #3: Decompiling Unity with dnSpy

For a side project of mine, I recently needed access to the implementations of some Unity Types like UnityEditor.MaterialEditor. Unity is not an open source platform and trying to understand its internal workings can be hard. Thankfully you can decompile Unity’s DLLs to get an insight of what is happening in the engine. My favorite tool for that is dnSpy. Just add the UnityEngine.dll and UnityEditor.dll from C:\Program Files\Unity\Editor\Data\Managed and you are ready to go. But be cautious because dnSpy can not only decompile but also change dll’s e.g. renaming types.