Hopefully this helps someone else....
I was having a similar issue. Idle time spiked in the profiler to like 400+ ms at a very odd time. No indication in the profiler as to which script might be causing this.
Turns out the culprit was calling .hide()
on a directional light at runtime. I tested this with V-Sync both on and off, same result. And I also tested this trying to call .hide()
on other things, but nothing else spiked quite like the light did. I can only speculate as to why, but maybe it has something to do with shadows / light baking?
Anyway, in my case I just fixed it by reducing the energy to 0.