C# DateTime inspector

I have made a few custom classes that need to hold DateTime information. However, DateTime is not one of the data types that show up in the Inspector.

Is it possible for me to somehow code a custom inspector that will then be used anywhere a DateTime is used (even embedded in any of my various custom classes)?

Based on my research so far, it seems like if you code a custom inspector for a class it only works for objects that are that class, not for objects that have an instance of that class. If so, then it looks like I may be out of luck (short of making a custom inspector for every one of my classes that has a DateTime variable). I’m hoping that’s not true.

I found this code to be ready for copy/paste and that works like a charm !

You can use a property drawer for a custom serializable class.

So if you create your date time class as a serialisable class you can include a variable of that type in as many scripts as you like and the Unity inspector will use the property drawer for it.