This is how I try to load my sprite images:

 sprite Sprites[];

void Start() {
...
Debug.Log("Sprite name: " + Sprites[8].name);
...
}


But it gives me the error that you can see in the picture below. Note that in the same figure there is a hierarchy of folders on the right side. I put two ellipsis in the code because it is actually much longer than what I posted, but I assure you that the script is correctly attached to the object and it generally works.

The problem is that it doesn't load the sprites as I expect: the debugger hangs at the point where the Debug.Log(...); is executed (precisely when it tries to access the Sprites vector which is probably empty).

It's the first time in Unity3D where I need to load the sprites in that way. I tried to look in some previous posts, probably I will have missed someone, but in those found until now no one has helped me.

Can someone help me to understand how to load the sprites and especially where is my mistake?

Update

I tried to check if could be a problem of static/dynamic arrays, but it seems not to be a problem of this type, in fact following code:

    Sprites = new ArrayList(Resources.LoadAll<Sprite>("Card/AnimalImages"));
Debug.Log("Size of dynamic array: " + Sprites.Count);


prints:

Size of dynamic array: 0

When in doubt, always read the docs for the methods you're using:

## Description

Loads all assets in a folder or file at path in a Resources folder.

If path refers to a folder, all assets in the folder will be returned. If path refers to a file, only that asset will be returned. The path is relative to any Resources folder inside the Assets folder of your project.

So when you call Resources.LoadAll<Sprite>("Card/AnimalImages"), Unity looks for files in a folder path like Assets/.../Resources/Card/AnimalImages. Because you have no such path in your project, it finds nothing, and gives you an array of zero length.
If there are assets that you want to load dynamically through code, you need to put them under a folder called Resources so that Unity knows to package them up into the built game, even if it doesn't see them referenced in any scenes.