Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Editor Compile in Background?

Discussion in 'Editor & General Support' started by larryPlayablStudios, Feb 11, 2019.

  1. larryPlayablStudios

    larryPlayablStudios

    Joined:
    May 15, 2018
    Posts:
    4
    Is there any way to have the editor recompile the project in the background on file change in an external IDE?

    Currently, I have to focus on the editor to kick off a recompilation.

    This would really help coding workflow.
     
  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    4,855
  3. larryPlayablStudios

    larryPlayablStudios

    Joined:
    May 15, 2018
    Posts:
    4
    Interesting, you're saying that I can access the running editor instance via command line and trigger an editor recompile? I don't want to do a full build. I just want to code in my external IDE and then have the editor already building or ideally ready to run when I tab back over to it.
     
  4. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    4,096
    Rider/Resharper's Unity plugin has a toggle for "automatically refresh assets in Unity", which does what you're asking. Maybe VS' plugin has something similar?
     
  5. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    4,855
    No, I was referring to a command line build.
     
  6. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    5,309
  7. larryPlayablStudios

    larryPlayablStudios

    Joined:
    May 15, 2018
    Posts:
    4
    Yeah, I'd noticed that as well. Looks like it launches a monitoring program that polls for file metadata updates (e.g. time updated) and then kicks off an asset refresh. Seems like a reasonable approach. I was just a bit nervous about running a pretty unknown quantity like this. I'm also on osx for now, and it utilizes an exe for the monitoring program. Could potentially be rebuilt for osx.

    Maybe I'll roll my own that uses an explicit system event sent from Visual Studio vs polling for file changes if I get around to it.
     
  8. vhman

    vhman

    Joined:
    Aug 13, 2018
    Posts:
    76
    It seems VS2019 + Unity 2019.1 do that out of box
     
    Lurking-Ninja, mgear and Ryiah like this.
  9. llMarty

    llMarty

    Joined:
    Dec 14, 2014
    Posts:
    30
    That's great, however, it binds you to to Visual Studio, some developers are on Visual Studio Code or other IDEs that are less bloated, so they cannot enjoy this feature. Also, it will not work for other types of assets that you edit in another software.

    However, I have a solution to this that I will share, once my tests are complete.
     
    ihysoal, DebugLogWarning and vhman like this.
  10. charlie_sbg

    charlie_sbg

    Joined:
    Dec 18, 2016
    Posts:
    13
    Haha. Came here because I just installed VS 2019 Community (but with Unity 2018.3.x) and now I want it to STOP compiling in background. (I don't want it to start every time I save a file!). Any ideas?
     
    laeusnb likes this.
  11. laeusnb

    laeusnb

    Joined:
    Jun 10, 2014
    Posts:
    29
    Exact same thing here. I need it to stop and am considering going back to 2017. It makes editing code so incredibly sluggish when it's constantly compiling and recompiling and re-recompiling. Is there any hack to disable it before we (hopefully) get an option to do so?
     
  12. Harriet92

    Harriet92

    Joined:
    Jul 2, 2015
    Posts:
    3
    Same here! I've just created a new folder in the Solution window and it vanished instantly (stopped being included) before I had time to insert any scripts there.
     
  13. Harriet92

    Harriet92

    Joined:
    Jul 2, 2015
    Posts:
    3
    @charlie_sbg @laeusnb I might have just found a solution! in Visual Studio go to Tools -> Options

    upload_2019-7-10_9-1-52.png

    It seems that it helped :) What a relief :)
     
    kromenak and LCStark like this.
  14. tosiabunio

    tosiabunio

    Joined:
    Jun 29, 2010
    Posts:
    107
    I actually love the compilation in the background, unfortunately very often, it doesn't want to stay in the background and the editor comes to the top, stopping me from writing the code. This is very annoying - is there a way to prevent the editor from popping up?