What to do for many comparison operations in foreach loop?
I am developing a soccer game. There are 28 spots on the field and i have to find the one with the Highest score so that i can move the supporting player (player who is supporting the player dribbling the ball) to that spot. As there are 28 spots and i have to compare each of them to determine the spot with highest score, this operation is lengthy and cannot be performed per frame in Update() function. I am using foreach loop to do the comparisons as 28 spots are "empty game objects". I have tried using coroutine but to no avail. When i play the game it becomes very slow and causes other game objects to misbehave. My question how can i do the comparisons in foreach loop without affecting the game's performance? Any help will be appreciated. Thank you.