#ok say we have

1 messages · Page 1 of 1 (latest)

ivory canopy
#

so that means that I have to manually enter 52 entries? 😔

heady hornet
#

how do you fill cardFaces now?

ivory canopy
#

like this atm

heady hornet
#

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"]

ivory canopy
#

i get it now, thanks

heady hornet
#

There is actually a much better way to do this but that is a discussion for another day

ivory canopy
#

if its not broken, dont fix it...

heady hornet
#

absolutely, not until you know much, much more

ivory canopy
#

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);
            }
        }