#ok say we have
1 messages · Page 1 of 1 (latest)
how do you fill cardFaces now?
like this atm
ok, so they are already set in the inspector. So you just use that as the input into the Dictionary Foreach loop I wrote
so your Dictionary entry for the first element in your Array will be
"AceHearts", Sprite(AceHearts)
and you can access it using
cardDict["AceHearts"]
i get it now, thanks
There is actually a much better way to do this but that is a discussion for another day
if its not broken, dont fix it...
absolutely, not until you know much, much more
i think i got it now,
could this theoretically work automatically where cardsStored is a dictionary of <string,Sprite>
List<string> newDeck = new List<string>();
foreach (string s in suits)
{
foreach (string n in number)
{
newDeck.Add(n+s);
string cardToSprite = (n + s).ToString();
Sprite cardSprite = Resources.Load<Sprite>("Sprites/"+ cardToSprite);
storedcards.Add(cardToSprite, cardSprite);
}
}