Is it possible to only recompile when I hit the play button?
Asked Answered
A

2

1

I jump between code and the Unity editor constantly. I want compilation to ONLY occur when I hit the play button. Is this possible?

Aladdin answered 3/2 at 22:28 Comment(0)
B
0

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 EditPreferencesGeneral, 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 editpreferencesasset pipelineauto refresh.

Bebel answered 3/2 at 22:29 Comment(1)

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
S
0

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

Spatola answered 3/2 at 20:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.