Is it possible for me to create a custom script that will fully disable auto refresh everywhere within Unity (not just on script changes; in my case, asset creation/deletion in addition to everything else)?
Or is this particular problem a bug that should be fixed by the Unity team (so that unchecking the "Auto Refresh" setting fully disables it in all locations that trigger it)?
Unchecking the Asset Pipeline -> Auto Refresh setting doesn't fully disable this
"Reload Script Assemblies" behavoiur. (i.e. the "stop everything and prevent you from being able to do anything, Unity is locking down to recompile things" behaviour.)
In particular I found that even though this setting is disabled, it still happens for every new or removed Asset (creating a script via Assets -> Right click -> Select
C# Script, or removing one by going to Assets -> Right click an asset -> Select
Delete). I'm not a fan of this Auto Refresh functionality (anywhere in Unity), it's very disruptive and annoying to keep running into it with very minor changes. I'm glad I am able to disable this and manually run the refresh when I'm ready for any of my script changes, but I still run into this frustrating problem.
In addition to the Auto Refresh setting being un-checked, I have my General -> Script Changes While Playing set to
Recompile And Continue Playing; this is fine but isn't the culprit as I'm not currently playing when this refreshing happens.
It feels like the problem is that other locations in Unity code that should be respecting the Asset Pipeline -> Auto Refresh setting, but aren't setup to respect it (either because it's a bug, or hasn't been implemented).
There's lots of articles about how to disable auto refresh, but I haven't found any that are specific to new or deleted assets (I've shared some of the links I've found below). Most sources I can find for disabling auto refresh are for updates I make to my existing scripts, for when I'm playing, or for creating a custom script to add my own logic (not quite sure how to do this yet, still researching this path).
A few links that are related to this issue
but aren't similar enough to help me solve this problem:
This one suggests adding a script that changes some Unity behaviour, but I haven't tested this yet as I'm not entirely sure how to do it (and I'm not convinced this will prevent the auto refresh from asset changes), but I'm currently researching this path in hopes I can try customizing auto refresh to happen when I want it to happen.
My system info:
- Unity version:
MacBook Pro macOS Catalina Version 10.15.7
Side Note: I recently asked this question on the
answers.unity.com website (question here), but I found out that site is shutting down soon (on June 23rd, 2022). Using Unity's forum is a mess, so I'm re-asking this here since Stack Overflow/Stack Exchange is a better Q&A community.