some qualifying information-
-making a card game infrastructure
-the GameObject being saved as a prefab has a “Card” component (im trying to save finished cards as prefabs)
-each card has a list of "Action"s. "Action"s are a non-monobehavior class which has a constructor with 2 parameters.
-each card works when played by a foreach() Action in the List cardEffect
-I setup a very basic, “in game” system to make cards and save them as prefabs. upon finding this issue I added a debug, which shows cardEffect.count when saving the card as a prefab
-I also added a debug to just before the foreach() mentioned above, also showing cardEffect.count (worth mentioning I have a null check on awake which makes cardEffect a new list if it == Null, so I dont crash when trying to play the card)
My issue is that the first debug.log shows the proper cardEffect.count, which for my simple test card is 1.
But when I go to play the card, and the foreach() gets called, it skips right over it because there are 0 “actions” in cardEffect. (and the debug.log just before it displays 0)
I also checked to see if some other, standard variables were being saved. An Int named cardTargetNum. It is being saved fine, just not my list.
So, are prefabs not intended to save information not entered through the inspector? Or it something to do with Lists? Or perhaps just using a non-standard variable class?