Unity can’t serialize a DateTime or a TimeSpan class right?
Would it be somehow possible to tell Unity how it should display a non Unity.Object class like DateTime?
I know you can write custom editors for Monobehaviors, ScriptableObjects etc. but it would be nice to write a “instructions” for a class how to display it so you don’t have to do it in every custom editor.
Hi @Nyyus ,
You can use a Property Drawer for this purpose: Unity - Manual: Property Drawers
Indeed, it seems that someone else already created and shared one for “DateTime”: C# DateTime inspector - Questions & Answers - Unity Discussions
The thread is a little bit old, so I’m not sure if the code there is still relevant, but you can take a look and maybe get a general idea
Good luck with it!
1 Like