Sort playerlist
Options
Anyway to sort playerlist. I wana sort players with their kills key. Anyway to achieve this
1
Comments
-
using System.Linq; List<PhotonPlayer> playerList = PhotonNetwork.playerList.ToList(); playerList.Sort(SortByKills); public static int SortByKills (PhotonPlayer a, PhotonPlayer b){ return b.GetKills().CompareTo(a.GetKills()); }
4