- Home /
Sorted assets when drag-and-drop into array?
I got an public AudioClip[] array in a C# script, which should contain (a lot) of sounds to be played by the script. I used to Resource.LoadAll() them from a folder, which nicely put the sounds into an array in ascending order by name, exactly how I need them.
When I just drag the sounds in the Editor into the script, they appear in randomized order. Interestingly always in the same randomized order.
Now, I could sort them before using the array, or index them by name, but is there no simple way to fill the array already sorted?
Your answer
![](https://koobas.hobune.stream/wayback/20220612082629im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to drag and drop sprites in order? 0 Answers
Array Ordering 3 Answers
Trying to sort an array. What's wrong here? 1 Answer
Sorting an array of vectors in javascript 1 Answer
On which place is my value in array? 1 Answer