How to preserve array of custom objects in inspector?

I have an array of custom objects (ScriptableObjects called “SlotData”) in my main controller script like so:

public class RosetteController : MonoBehaviour

	public SlotData[] slots = new SlotData[15];

	void Awake()

		for ( int i = 0; i < slots.Length; i++ )
			slots *= (SlotData) ScriptableObject.CreateInstance("SlotData");*
  •  }*
  • }*

I’ve made a custom editor script that lets me see & edit all of the custom object variables in the inspector (I had to do this as I’m using setters & getters in the custom “SlotData” class)
However, the objects in the array only seem to exist during runtime - once I come out of playmode, all of the objects in the array are destroyed which is causing me some problems.
The inspector knows & shows that 15 SlotData objects are in the array, but the actual objects that the arry elements refer to are set back to null on exiting playmode - if I try to look at any of the elements of the array outside of playmode, there’s nothing there.
Is there any way to get Unity (or the inspector) to preserve the objects or values that are created/assigned to the array outside of playmode?
For example, if my array were an array of ints, the elements of the array would be preserved outside of playmode - I could see & edit the elements in the array (int values) in the inspector.
I’d like to be able to do the same with my custom objects, but I can’t figure out how to get Unity to preserve my objects.

If you want to store them permanently, you can use the OnValidate Function