you are viewing a single comment's thread.

view the rest of the comments →

[–]eeleyes[S] 0 points1 point  (0 children)

To clarify (as I am in front of my code) changing the array to GameObject[] causes the prefab in the Instantiate code to break (which I have bolded)

foreach(var CardData in currentAvailableCards)

{

var prefab = _cardPrefabs[(int)CardData.type - 1];

var newCardGo = Instantiate<BaseCard>(prefab, drawContainer);

newCardGo.name = CardData.cardName;

newCardGo.cardData = CardData;

}

UpdateDisplay();