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
.
Recompile when hit the play mode button would be AWESOME!
I disabled the auto refresh, and I need to manual recompile after hit the button and sometimes I forget to ctrl+R, so it should have an option to recompile when hit play mode button
© 2022 - 2024 — McMap. All rights reserved.
Manual refresh is usually the first setting I change after installing Unity (together with 'recompile after finished playing'). Saves a lot of time. You will soon make a habit of hitting ctrl+r when you need to.
– Killen