Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

Resolved Editor Compiles after File Operation! Normal behaviour?

Discussion in 'Editor & General Support' started by Imperatoss, Nov 8, 2023.

  1. Imperatoss

    Imperatoss

    Joined:
    Mar 24, 2018
    Posts:
    51
    Hi everyone,

    the editor compiles scripts after each file change. If I duplicate or delete a file (not a script file, but a texture or terrain layer) then it recompiles everything. This takes a lot of time in a large project.

    Does anyone have the same experience or a solution to the problem?
     
  2. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    8,417
    If you have any code changes that have not yet been recompiled, a change to any files will cause that to happen and initiate a domain reload.

    If there are no code changes to be compiled then there shouldn't be a domain reload.
     
  3. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    7,004
    Exactly. And if there's any kind of editor script that, if some specific or even *any* assets are modified also modifies scripts, then that will also lead to a recompile / assembly reload.
     
  4. Imperatoss

    Imperatoss

    Joined:
    Mar 24, 2018
    Posts:
    51
    I dont have any Code Changes. I´ll try to find out what exactly is the cause to that behaviour
     
  5. Imperatoss

    Imperatoss

    Joined:
    Mar 24, 2018
    Posts:
    51
    Oh man, it took me a while to find it because I've hardly used the profiler so far.
    An old asset has called HelperCompiler.OnWillDeleteAsset(), and this leads to CodeEditorProjectSync.SyncEditorProject() being called, which compiles the entire project again.

    After I removed the asset, the editor runs much faster and better.
     
    spiney199 likes this.