GlobalConfig serialization issue upon recompilation

Issue #874 new
Will Poillion created an issue

I mentioned this issue in the OdinHelp channel of the discord, and Bjarke responded to it asking for a sample project. I created a ‘GlobalConfig Serialization issue upon recompilation’ thread to bookmark it. I just wanted to mention that first.

I’m using Unity 2021.3.8f1 and just downloaded and am using the latest source 3.1.3.0.

Just FYI, I did have to update the Sirenix.Utilities.Editor assembly to reference Sirenix.OdinInspector.Attributes to compile the 3.1.3.0 source. Bjarke helped me with that one on 9/1 in the discord.

I’ve attached a screenshot with the specific exception I’m getting. But the error isn’t extremely helpful in troubleshooting. I was able to isolate and reproduce it, however.

The issue doesn’t occur when you initially load the project. It only happens upon forced recompilation once Unity has already loaded. As such, I included a simple ‘Recompiler’ script that forces recompilation with shortcut ‘Ctrl+`’

Included code:

  1. Scripts/Globals - OG.cs is the GlobalConfig class causing the errors. As you can see within it, it’s compromised of [Serializable] marked sub-classes for organization.
  2. GlobalsWindow - The EditorWindow for the OG class. If this is open during recompilation the error will immediately surface.
  3. ExecuteAlwaysGlobalConfigTester.cs - A monobehavior I created during discovery the bug root cause. The error surfaces immediately when Monobehaviors are marked [ExecuteAlways] and try to make use of the OG class. I have many such helper components, so this was the initial catalyst for the first errors I saw.

If you guys need any additional help reproducing let me know! I was surprised I was actually able to isolate it.

Thanks guys!

Will

Comments (0)

  1. Log in to comment