how to read/load sprite into array during run time c# unity

HI all

I am creating a card game (52).I have a single sprite in my Unity and Its having all playing card in a single image and I adjusted through sprite editor and it shows different values for each card.

I have 8 slots in the game area and I need to display any 8 cards into these slots using c#. In order to happen this , I have started with array and I find difficult to read from sprite and show each cards in slot.

Can any one guide me best prcatise and how to do ?

Well, what you can do is create a folder called “Resources” (Assets/Resources) and there put all your sprites…
And in your code you can do something like:

mySpriteRenderer.Sprite = Resources.Load<Sprite>("MySpriteName");

Remember that all your sprites need to be inside the “Resources” folder, but if you create another folder
inside it:

mySpriteRenderer.Sprite = Resources.Load<Sprite>("folderName/MySpriteName");

Now multiples sprites:

  var sprites = Resources.LoadAll<Sprite>("folderName");

  for(int i = 0; i < sprites.Length; i++)
         myImagesArray_.sprite = sprites*;*_


What’s myImagesArray?
I’d like you to tell me more about it.