show score

This commit is contained in:
Marine 2024-02-25 18:30:14 +01:00
parent 1158270ca6
commit c10683a6f6

View File

@ -39,11 +39,13 @@ public void Initialize(Room _room)
scoreByUser = scoreByUser.OrderByDescending(x => x.Value).ToDictionary(x => x.Key, x => x.Value);
List<string> playersId = scoreByUser.Keys.ToList();
for ( int i = 0; i < playersId.Count; i++)
int countPlayers = scoreByUser.Keys.ToList().Count;
for (int i = 0; i < countPlayers; i++)
{
Player p = _room.GetPlayerById(playersId[i]);
Player p = _room.GetPlayerById(scoreByUser.Keys.ToList()[i]);
playerStickers[i].gameObject.SetActive(true);
playerStickers[i].Initialize( p.name , i);
string nameAndScore = p.name +'\n'+ scoreByUser[p.id] +" pts";
playerStickers[i].Initialize(nameAndScore, i);
}
}