Is there a more efficient way to do this? Without doing it manually? //adding images to the puzzle pieces puzzlePieces[0].sprite = Images[0]; puzzlePieces[1].sprite = Images[1]; puzzlePieces[2].sprite = Images[2]; puzzlePieces[3].sprite = Images[3];
Using a for loop. Iterate through to the length of one array. I don't think Copy would work, since in his example the arrays aren't the same type.
So like this? Code (CSharp): using UnityEngine for (int i = 0; i <= puzzlePieces.Length; i++) { for (int j = 0; j <= images.Length; j++) { puzzlePieces[i].sprite = Images[j]; } }
To be more clear: You must not nest them as the code would not make any sense this way ^^. Also the code need to use <, not <=