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. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  3. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Bug Tabbing over from VS without saving causes inadvertent refresh (when manual refresh)

Discussion in '2020.1 Beta' started by MrLucid72, Jun 3, 2020.

  1. MrLucid72

    MrLucid72

    Joined:
    Jan 12, 2016
    Posts:
    1,005
    If I make changes in VS and tab back, Unity is not supposed to reload if I turned on manual refresh. In 2019.1, this was fine -- only in 2020.1 ~

    (PS: Any plans to fix the thread-locking global refresh? I can have a brand new scene with nothing inside, change 1 thing, and it scans my entire project / every scene if I refresh -- it's not smart, nor is it optimized).
     
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,623
    Do you use Visual Studio Tools for Unity? In case you are, perhaps it's related to this option:

    upload_2020-6-3_9-54-2.png
     
    MrLucid72 likes this.
  3. MrLucid72

    MrLucid72

    Joined:
    Jan 12, 2016
    Posts:
    1,005
    Oooohhh.... I wonder if Tools for Unity can override this, depending on what option is chosen in Unity. I'd still arguably call it a bug. Good find, though. Thanks!
     
  4. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,623
    @sailro @jbevain

    I guess Tools for Unity doesn't override the Unity option, it just calls
    AssetDatabase.Refresh
    manually (on purpose, because the option says so).

    Maybe VSTU should read whether "Auto Refresh" is enabled in Unity and only call Refresh when it's. But then you could argue it's a bug in VSTU, because their "sync" wouldn't work anymore if it's turned off in Unity.

    Maybe VSTU should not have a True/False option, but have three options instead:
    • Never Refresh
    • Always Refresh
    • Refresh if "Auto Refresh" is enabled in Unity
     
    mahdi_jeddi likes this.
  5. sailro

    sailro

    Microsoft

    Joined:
    Jul 30, 2014
    Posts:
    167
    Yes this is on our radar. What we planned going forward is to keep the VS setting as is, but on the Unity side:
    - always call AssetDatabase.Refresh for Unity versions not supporting the AutoRefresh setting
    - call AssetDatabase.Refresh for Unity versions supporting the AutoRefresh setting if AutoRefresh = true
     
    Peter77 likes this.
  6. sailro

    sailro

    Microsoft

    Joined:
    Jul 30, 2014
    Posts:
    167
    Fixed in both VSTU (for 2019.x and before) and the VS package (2020.x+) masters.
     
    MrLucid72 likes this.