How to display TimeSpan in the inspector?

I have a class that uses TimeSpans, but I can’t view them in the inspector for editing despite making them public.
I even tried making a propertyDrawer for it but that doesn’t work.
How can I get timespans to show up in the inspector?

This is especially problematic as I have an Activity:ScriptableObject class that I’m saving to .asset files, but it seems the TimeSpan gets stripped from the file.

If you just want to DISPLAY the timespan, you can use a text field, and in it, display the results of the Timespan.ToString() function.

If you want to be able to enter seconds, minutes, hours, days, etc… You will need to create a custom property drawer for the TimeSpan type, that has files for each of these time-units.

Regarding it not showing up in your scriptableObject asset: I’m not sure if TimeSpan is serializable (though I would have thought it was.)

If it’s NOT, you will need to manually convert the TimeSpan object to data that IS serializable (like and few intergers; one for seconds, one for hours, one for days). This is generally done by implementing the Unity - Scripting API: ISerializationCallbackReceiver on the ScriptableObject class.