I jump between code and the Unity editor constantly. I want compilation to ONLY occur when I hit the play button. Is this possible?
That’s not possible as far as I know BUT this setting saved me a lot of lost time waiting for it to recompile all the time, when I’ve made a change in code and am playing the scene already. The new setting doesn’t let it recompile until I’ve stopped playing, I’ve found this useful as most of the time if I make a change during play mode I start getting a load of null references and the game is unplayable anyway so I have to wait for it to recompile to then have to stop and restart again anyway, where it gets recompiled a 2nd time!
You can change this behavior by going to Edit > Preferences > General, click the drop-down to the right of Script Changes While Playing and click Recompile After Finished Playing.
There’s another setting you can turn off called “auto refresh” but I’ve found this to be more trouble than it’s worth as I forget to refresh manually by pressing ctrl+r before playing the scene, then my new code isn’t compiled.
If you wan’t to try that though it’s at edit > preferences > asset pipeline > auto refresh.