Hello. I have two arrays(firstArray & secondArray), and what I want to do is go through all of the variables inside them through a for loop function, with the help of another array(arrayIndex), just to preserve the code size.
var arrayIndex = new Array("firstArray","secondArray");
var firstArray = new Array("f0","f1","f2","f3");
var secondArray = new Array("s0","s1","s2","s3");
for(var x = 0; x <= arrayIndex.length;x++) {
for(var i = 0; i <= 3;i++) {
Debug.Log((arrayIndex[x]).*); //★ this doesn't work the way I need*
}
}
Can anyone point me out the way to make (★) work? And is this the right way of doing it, or should I just use a different dimension Array for this? If you could give me an example, that would be great. Thanks in advance.