I'm using 'for each loop' to pick values of a one dimensional array and copy them to a 2 dimensional array. But the problem with 'for each loop' is that somehow it is slowing down my game FPS on mobile devices (about 15 FPS slower).
I've done some testing disabling the 'for each loop' and the game runs smoothly (60 FPS). So i've tried to figure out how to do the same process without using the 'for each loop', but i couldn't. I've tried 'while loop' but wasn't able to make the copy work properly.
The only noticeable improvement (with the 'for each loop') was made by deleting the current X value of the one dimensional array after copying it to the second array. But it still slowing down the game, although less than before.
So my hope is to get some help on how to do this process without the 'for each loop', to see if the FPS may stand on 60. Any suggestion will be pretty much appreciated!