I’m noticing some odd behavior around prefab-vs-unpacked objects with array properties. I have a MonoBehavior script with an array of a Serializable class as a public property. As expected, this shows up in the inspector, I can add and remove elements, and they persist when saving and quitting Unity, run the game from the editor, etc.
What’s odd is that if I put that MonoBehavior script on a prefab, and pull the prefab into the scene, suddenly I lose the contents of the array any time I run the game in the editor, or save and quit. If I unpack that prefab, then setup my array on the unpacked object, it works as expected again.
Is this the intended/expected behavior? Non-array properties on the same script seem to keep their values. Feel like I must be missing something here. I’m guessing it’s pulling the empty list from the prefab for some reason, but I’m not sure why it’s only doing that for the array.