I’ve got a driving simulation that is getting bogged down when there are a lot of vehicles in the scene. Most of the time is going into the driver AI; I suspected that already, and the profiler confirms it. This is not unexpected, as the driver AI is complex and is really the whole point of this particular project.
But the profiler just shows that 46% of the time is spent in Driver.Update (of which, 0.8% is in Physics.Raycast). But Driver.Update is a trivial function that just calls into the various modules of the AI, which are not MonoBehaviours. I don’t see those show up at all. So I can’t even tell how heavy the various modules are, let alone drill down to find someplace where one of them might be spending a surprising amount of time.
Is there really no way to get Unity’s profiler (or, really reaching here, something in MonoDevelop maybe) to work on all methods?
(Note: I’m aware of Profiler.BeginSample/EndSample, but if I have to insert that into every method in the whole AI code base, it’s going to take all day… I’m hoping for something more like Apple’s profiling tools, which allows you to drill down arbitrarily deep in any code you have symbols for.)