Editing a struct of an unknown type in the inspector

So here’s the problem I have; I want to pass a bunch of data from one scene to another in a generic manner. So in scene 1 you could have a script with a dropdown box to choose the type of data you want to configure, then the inspector would show the values of that struct. Then scene 2 would be able to read that data.

My issue is mostly with getting the inspector to display this. Is it possible to do this with a custom inspector, without having to manually create an inspector for each struct?

You can create an editor: Unity - Scripting API: Editor.CreateEditor
Or call ObjectField with the correct type: Unity - Scripting API: EditorGUILayout.ObjectField