Quickly assigning to array in editor

Let’s say you have a public array with 50 variables and you want to assign to each of them
a different asset( same type of assets, all are textures but each variable holds a different texture). Is there a way to quickly assign all of the assets to array?
And not drag and drop each of them, it can be boring and tedious :slight_smile:

Yes and no. If you look in the upper right corner of the Inspector window, you will see a lock symbol. Select the game object that has your array and then click on the lock symbol, that game object will continue to be displayed in the Inspector as you navigate in the Project pane. You can then navigate to whatever you want to populate the list with and select all of your objects and drag and drop them onto the name of the array. This will populate the list all at once. But the problem is the results do not appear to be sorted! So if you are just going to be pulling things out of the array randomly, it works great, but if you need them in the named order, it does not work. Oh so close.

As an alternative, you can put all of your files in a subfolder off of the Assets/Resources folder. Then you can dynamically load them with Resources.LoadAll(). They come in in named order. Or I you could write an editor script to populate your array(s).