unity get the amount of objects in array code example
Example 1: unity get number of child objects
// The number of child objects is given by:
GameObject.transform.childCount;
Example 2: array with objects read element with the lowest value
myArray.reduce(function(prev, curr) {
return prev.Cost < curr.Cost ? prev : curr;
});