Hi,
We recently installed the Hot Reload plugin for Unity (Download | Hot Reload for Unity) which made us change our preferences settings to “Recompile After Finished Playing”. The problem is that when we exit the play mode, Unity tries to recompile and fails to do it because of FMOD. The window “Reloading domain” can’t disappear and we have to kill Unity process. Here is the editor.log part that explain the problem :
Reloading assemblies after forced synchronous recompile.
Begin MonoManager ReloadAssembly
Thread 0x381d87000 may have been prematurely finalized
UnityException: Load can only be called from the main thread.
Constructors and field initializers will be executed from the loading thread when loading a scene.
Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.
at (wrapper managed-to-native) UnityEngine.ResourcesAPIInternal.Load(string,System.Type)
at UnityEngine.ResourcesAPI.Load (System.String path, System.Type systemTypeInstance) [0x00000] in /Users/bokken/build/output/unity/unity/Runtime/Export/Resources/Resources.bindings.cs:71
at UnityEngine.Resources.Load (System.String path, System.Type systemTypeInstance) [0x00001] in /Users/bokken/build/output/unity/unity/Runtime/Export/Resources/Resources.bindings.cs:122
at UnityEngine.Resources.Load (System.String path) [0x00001] in /Users/bokken/build/output/unity/unity/Runtime/Export/Resources/Resources.bindings.cs:112
at FMODUnity.Settings.Initialize () [0x0001a] in /Users/francois/Projects/Arckhania/Assets/Plugins/FMOD/src/Settings.cs:267
at FMODUnity.Settings.get_Instance () [0x0000f] in /Users/francois/Projects/Arckhania/Assets/Plugins/FMOD/src/Settings.cs:255
at FMODUnity.RuntimeUtils.DebugLogError (System.String message) [0x00001] in /Users/francois/Projects/Arckhania/Assets/Plugins/FMOD/src/RuntimeUtils.cs:572
at FMODUnity.RuntimeManager.DEBUG_CALLBACK (FMOD.DEBUG_FLAGS flags, System.IntPtr filePtr, System.Int32 line, System.IntPtr funcPtr, System.IntPtr messagePtr) [0x00023] in /Users/francois/Projects/Arckhania/Assets/Plugins/FMOD/src/RuntimeManager.cs:77
at (wrapper native-to-managed) FMODUnity.RuntimeManager.DEBUG_CALLBACK(FMOD.DEBUG_FLAGS,intptr,int,intptr,intptr)
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception)
UnityEngine.<>c:<RegisterUECatcher>b__0_0(Object, UnhandledExceptionEventArgs) (at /Users/bokken/build/output/unity/unity/Runtime/Export/Scripting/UnhandledExceptionHandler.bindings.cs:46)
UnityEngine.ResourcesAPIInternal:Load(String, Type)
UnityEngine.ResourcesAPI:Load(String, Type) (at /Users/bokken/build/output/unity/unity/Runtime/Export/Resources/Resources.bindings.cs:71)
UnityEngine.Resources:Load(String, Type) (at /Users/bokken/build/output/unity/unity/Runtime/Export/Resources/Resources.bindings.cs:122)
UnityEngine.Resources:Load(String) (at /Users/bokken/build/output/unity/unity/Runtime/Export/Resources/Resources.bindings.cs:112)
FMODUnity.Settings:Initialize() (at Assets/Plugins/FMOD/src/Settings.cs:267)
FMODUnity.Settings:get_Instance() (at Assets/Plugins/FMOD/src/Settings.cs:255)
FMODUnity.RuntimeUtils:DebugLogError(String) (at Assets/Plugins/FMOD/src/RuntimeUtils.cs:572)
FMODUnity.RuntimeManager:DEBUG_CALLBACK(DEBUG_FLAGS, IntPtr, Int32, IntPtr, IntPtr) (at Assets/Plugins/FMOD/src/RuntimeManager.cs:77)
(Filename: Assets/Plugins/FMOD/src/Settings.cs Line: 267)
Notes :
- Macbook Pro M1 Max 16"
- Unity 2022.2.5f1 (silicon build)
- FMOD 2.02.11 (tested with 2.02.09 too)