Quantcast
Channel: Recent Discussions — Photon Engine
Viewing all articles
Browse latest Browse all 15755

How to display the PhotonNetwork.playerList as a ranking?

$
0
0
Cheers guys and happy new year :)

What's the recommended way to get a player custom property and print every player ranked using photon networks player list?

I'd try something like this but I cannot figure out how to code that the score get's ranked and displayed in the correct order? :

void DisplayRanking()
{
foreach (PhotonPlayer player in PhotonNetwork.playerList)
{
int score = (int)player.CustomProperties["score"];

// but how to code that the score now get's ranked and displayed in the correct order?
display.text += (player.NickName + " Score: " + player.CustomProperties["score"] + " \n");
}
}


Greets

Viewing all articles
Browse latest Browse all 15755

Trending Articles