Fastest way to assign sprites to components in Unity

(Cross posted from http://gamedev.stackexchange.com/)

I’m using a sprite atlas and Unity’s built-in sprite editor to tease out the individual images. Specifically, I have a single texture containing lots and lots of icons for armor, and I am assigning those to a Sprite[] field of a Component.

However, the process of manually assigning sprites to the component – via drag and drop – is tedious. Is there a faster way to do this? Perhaps a way I can bulk assign sprites to a component?

Screen shot of what I'm describing


Update: If you put the texture atlas in the /Resources folder, you can load all of its sprites programmatically via:

Sprite[] atlasSprites = Resources.LoadAll<Sprite>(atlasName);

This seems like the best way to accomplish what I was trying to solve.

66973-screenshot-2016-03-30-181745.png

You see that lock icon in the corner. If you click that then the inspector won’t change and you can select all the sprites and drag it to the necessary script component array.

Hi. What happens if you drag a number of sprites into the main array section (not an individual element). I think this is roughly over where the word “size” is (the mouse pointer should change). That’s normally how I would add a number of objects to a list/array in one go, however I’ve not tried this with sprites. As a workaround, you could add a custom inspector for your components that use the selection to add items in bulk. Hope that helps =D