wip: try to fix local i issue
This commit is contained in:
parent
274d4cc3dc
commit
fa45a83124
@ -18,18 +18,19 @@ public void ShowQuestion(Question currentQuestion)
|
||||
{
|
||||
List<Proposition> props = currentQuestion.propositions.Values.ToList();
|
||||
promptLabel.text = prompts.GetPromptById(currentQuestion.promptId).en;
|
||||
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
int index = i; // Capture la valeur de i pour cette itération
|
||||
StorageManager.ConvertGoogleStorageURLToHttpsUrl(props[i].photoUrl, _httpURL =>
|
||||
{
|
||||
StartCoroutine(StorageManager.DownloadImage_Coroutine(_httpURL, (Texture texture) =>
|
||||
{
|
||||
Sprite sprite = Sprite.Create(texture as Texture2D, new Rect(0, 0, texture.width, texture.height), Vector2.zero);
|
||||
btns[i].sprite = sprite;
|
||||
btns[index].sprite = sprite; // Utilise l'index local au lieu de i
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user