Sharing an Utility to Delete Empty Methods in Unity Projects


When creating a new script in Unity, the Start and Update callbacks are added by default. The problem is that these callbacks will be called by the Unity Engine even if they are empty, and will not be pruned when building for release. This can eat up quite a lot of your frame budget!

Build Settings Screen
Profiling the difference in performance between 30000 empty GameObjects without and with empty callbacks, from Unity Game Optimization, 3rd Edition

It is easy to forget some empty methods here or there so I made a simple GUI tool that will parse all your cs files and delete empty methods.

The Code & Windows release are available on Github!

To note: I made it in C# with WPF so it only builds for Windows. Stay tuned for solutions for Mac and Linux!