Closed yrokhlin closed 4 months ago
Yeah this does seem 100% to be an Odin issue. I see no reason your patch cannot be marked as a solution though. If you want to make a PR I can merge it so you can get credit, no worries otherwise.
Resolved in 4.3.6
General Unity version: 2021.3.5f1 Fish-Networking version: 4.3.4R PRO Discord link: https://discord.com/channels/424284635074134018/1247017550609518602
I have posted about this on the discord priority help and was encouraged to write this ticket.
Replicating this issue is quite easy, simply spawn a
GameObject
that has a script attached with a class that uses theOdin serializer
and aSyncDictionary
as well. This is the method used to achieve Odin serialization : Mentioned here in the Sirenix DocsThis causes the SyncDictionary to become null, and will throw exception on
Spawn()
every time.An example of the exception:
SyncDictionary initialization values become null:
Jetbrains: Rider throws a warning about the initialization of those fields:
Fields initializer value is ignored on initialization
I have debugged with Jetbrains: Rider, so I can confirm the values are null on start:
I have temporarily hacked my way around the issue by adding the following lines to
SyncDictionary.cs
. I now initialize those values in theInitialized
functions, seems to work, but not 100% sure this is the right solution here.Additional Consideration
I also suspect that this might have something to do with issue #9 -- the
[SyncObject]
no longer exists, so maybe it has something to do with that? Not sure.