Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Feedback Avoid wait when scripts are renamed/moved/created

Discussion in 'Experimental Scripting Previews' started by Crayz, Nov 8, 2020.

  1. Crayz

    Crayz

    Joined:
    Mar 17, 2014
    Posts:
    193
    Unity imports/compiles every time a script is renamed, moved, created, or deleted.

    Is it possible that when Auto Refresh is disabled these actions don't force a refresh?

    10 seconds per action seems like a minor problem, but:

    1. Spending 8+ hours a day it adds up and reduces the user experience to the point it's often better to switch to Windows file explorer.
    2. Unity tends to have slowdowns, imports, pauses quite often, it would be nice to eliminate some of that.
    3. When you're in a state of productivity it's frustrating.
    4. It probably gets worse as the project size increases.

     
    Xarbrough, NotaNaN, MlleBun and 11 others like this.
  2. jasonboukheir

    jasonboukheir

    Joined:
    May 3, 2017
    Posts:
    83
    Completely agree. My workaround is to move assets and their meta files outside of the filesystem if I need to rename or move many files. Would be great to be able to hit a toggle in the editor, do all my moving and such then click the toggle again
     
  3. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    1,188
    I thought/wished that turning auto refresh off would fix this issue. However, this will only prevent the AssetDatabase from importing assets as soon as Unity is focused. Moving a script still recompiles.

    Maybe that’s even a bug. To me it would make sense to only compile when I manually trigger the refresh...
     
  4. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,884
    yeah this is obnoxious, I didn't used to get this issue on older Unity versions. But it really is a pain, taking longer and longer with the bigger a project gets.
     
  5. MlleBun

    MlleBun

    Joined:
    Sep 19, 2017
    Posts:
    163
    Yeah, it's so annoying having to wait for so long. The most unexpected wait time was when I had a 3-5 mins wait when the only thing I did was to click on a window. I still get those when toggling a tab (> 3 mins to wait).

    Update : An example I just got while posting this message. I just toggled from Occlusion window to the Inspector and clicked on Play :
    Application.Reload -> till 01:14
    Then Application.EnterPlayMode-> till 01:20 + some Inspector.InitOrRebuild + GUIView.RepaintAll.PlayerLoopController + some TickGlobalCallbacks message
    UpdateAllMenus -> till 01:30
     
    Last edited: Dec 9, 2020
  6. Zecrah

    Zecrah

    Joined:
    Nov 1, 2016
    Posts:
    7
    Totally agree. A lot of time is stuck in Inspector.Tick for me when tabbing back in, even if only minor tweaks were made or just a file moved like you say. I'm in 2021.1.0a9 and it's pretty rough still.
     
  7. runner78

    runner78

    Joined:
    Mar 14, 2015
    Posts:
    789
    I generally only create/rename/remove scripts in VS, only when I rename MonoBehaviors do I still do it in the editor.

    If you create a MonoBehavior, recompile is necessary to add it to an GameObject. If you have the option to deactivate the autocompile it needs a manual compile button, and I have seen many people forget that and wonder why a monobehavior cannot be added to a GameObject.
     
  8. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    1,188
    Renaming or moving scripts via the IDE to avoid is not a perfect solution. I do it in Rider a lot, but they also have specific support for Unity by also managing meta files, however such a third party does have bugs and more often than not I end up with metadata conflicts or Unity's compiler locking up. I guess it would make sense to fix the compiler lock bug and also for Rider to fix their metadata handling, but just for some more hope in the future, Unity should also make it possible to disable recompilation while moving scripts in the editor. :p
     
    FernandoMK likes this.