unity for each array code example
Example 1: for loop unity
for (int i = 0; i < 50; i++)
{
//Do something 50 times
}
Example 2: for each array javascript
var fruits = ["apple", "orange", "cherry"];
fruits.forEach(getArrayValues);
function getArrayValues(item, index) {
console.log( index + ":" + item);
}
/*
result:
0:apple
1:orange
2:cherry
*/