Search Unity

  1. Unity 2019.1 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:
    3,914
  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:
    3,758
    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:
    3,914
    No, I was referring to a command line build.
     
  6. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    5,055
  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:
    58
    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:
    29
    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.
     
    DebugLogWarning and vhman like this.