- changed status to closed
Are static variables supported?
Issue #174
closed
I'm looking into buying this asset, and I want to know if static variables are serialized. You said you serialize everything but I want to make sure.
Comments (1)
-
- Log in to comment
Odin doesn't serialize static variables on its own - nor will it ever, as there is no proper "general" way of doing it that isn't terrible, unreliable and hacky.
If you really want to, you can pretty easily make our serialization system serialize your static variables (it is highly extendable), and you can also show them in the inspector with a few small tricks, but it will never do so on its own.
In general, though, we would recommend using other approaches. Odin, for example, supports serializing "singleton-like" references, using .NET's IObjectReference interface, which Odin's serialization fully supports.