This commit is contained in:
RochesterX
2025-03-28 13:00:37 -04:00
parent 4c22943273
commit 451bf78249
13 changed files with 1767 additions and 1287 deletions

View File

@@ -42,13 +42,23 @@ public class LeaderboardManager : MonoBehaviour
public void UpdateLeaderboard()
{
List<KeyValuePair<GameObject, float>> sortedList =
new List<KeyValuePair<GameObject, float>>(GameManager.playerHoldTimes);
List<KeyValuePair<GameObject, float>> sortedList = new List<KeyValuePair<GameObject, float>>(GameManager.playerHoldTimes);
sortedList.Sort((pair1, pair2) => pair2.Value.CompareTo(pair1.Value));
foreach (var player in sortedList)
{
Debug.Log(player.Key.name + " : " + player.Value);
}
// Less fancy sorting system
foreach (var player in sortedList)
{
playerIcons[player.Key].transform.SetSiblingIndex(sortedList.IndexOf(player));
}
//foreach (var key in GameManager.playerHoldTimes)
//{
// print(key.Key.name + " : " + key.Value);
// }
}
}