Yeah I got the same 4 errors in a row after updating from 2021.2.9 to 2021.2.18. Someone at Unity made a whoopsie…
To fix this you’ll probably have to delete your Library folder and reopen (meaning a lengthy reparse of) the entire project. That’s how I fixed it on my end.
Same issue, I found out that deleting all assets of a custom ScriptableObject class resulted in less error messages. I’m wondering if it’s because of some AssetDatabase or Resources loading instructions which are called from OnBeforeSerialization.
The good point is that Unity doesn’t crashes anymore (well almost), so maybe this error is Unity telling us it prevented some unsafe code from executing ?
Otherwise the issue they discovered was that in some versions of Unity, not others, calling the prefab API during serialisation is a no go and throwing this error.
I just upgraded to the recent 2020 LTS and am now getting this on 2020.3.33f1, not using Odin Inspector. Log just spams:
Objects are trying to be loaded during a domain backup. This is not allowed as it will lead to undefined behaviour!
UnityEditor.Graphing.GraphObject:OnBeforeSerialize ()
A fix for this in Odin Inspector is on its way to the Asset Store, we’re just waiting for it to get approved. It’s available for download on the website now though.
I was not the one who did the fix, but reading off the changelog :p:
I think it was because ISerializationCallbackReciever was getting hit during an AssemblyReload event where utilizing the Prefab API (and various other API’s I Imagine) is now illegal. So the fix was to detect an assembly reload was occurring, and not do the prefab stuff in such cases.
As a LTS the quality is terrible, i’m having all kinds of small bugs and i’m too busy to search all of them or open a bug report.
Unity team should really rethink this LTS releases, i already regret having updated my project, 2020.3 was way too stable and less buggy.
I’m getting this same messages, but i’m not using anything serialization related, this 100% a editor bug:
"Objects are trying to be loaded during a domain backup. This is not allowed as it will lead to undefined behaviour!