I have the following call:
GameSmart.HighScores.Load(Order.Descending, (HighScoresLoadedResponse response) => {
foreach(Score score in response.data.scores){
GameSmart.GetImage(score.avatar, (Sprite sprite) => {
print(score.score);
});
}
});
In my foreach
, can I somehow pass the value of score
to the anonymous function to be used when the anonymous function gets executed? What I have now always displays the last value in the Score
array every time the anonymous function executes.
Here is the definition of GetImage
public static void GetImage(string url, Action<Sprite> onComplete = null)