How could I sort an array of gameobject from greatest to least. Each game object has a script with a number on it. I want to sort that array from one with greatest to least. How could i do this?
You can do this:
import System.Linq;
...
var sortedArray = originalArray.OrderBy(function(g) g.GetComponent(SomeScript).theNumber).ToArray();