Answer the question
In order to leave comments, you need to log in
How to reorder prefabs by name in an array?
I get prefabs from resources, there they are in this order
Test-1, Test-2, .... Test-10, Test-11...
Test[] ArrayTest = Resources.LoadAll<Test>(Path);
Test-1, Test-10, Test-11, Test-2.......
Answer the question
In order to leave comments, you need to log in
var array = new List<string>()
{
"Test-2",
"Test-1",
"Test-5",
"Test-4",
"Test-3"
};
Debug.WriteLine(string.Join(Environment.NewLine, array.OrderBy(item => item)));
Test-1
Test-2
Test-3
Test-4
Test-5
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question