コード例 #1
0
ファイル: LevelManager.cs プロジェクト: koennie93/ggj2019cg
 private void SetEndScreen()
 {
     float[] scoreOrder = ControllerManager.Instance.controlDictionary.OrderByDescending(c => c.Value.score).Select(c => c.Value.score).ToArray();
     Debug.Log(scoreOrder.Length);
     for (int i = 0; i < scoreOrder.Length; i++)
     {
         for (int j = 0; j < ControllerManager.Instance.controlDictionary.Count; j++)
         {
             if (scoreOrder[i] == ControllerManager.Instance.controlDictionary.ElementAt(j).Value.score)
             {
                 if (j + 1 == 1)
                 {
                     endScreen.SetText(i + 1, "Player" + (j + 1) + " - " + scoreOrder[i] + " Points", Color.red);
                 }
                 else if (j + 1 == 2)
                 {
                     endScreen.SetText(i + 1, "Player" + (j + 1) + " - " + scoreOrder[i] + " Points", Color.blue);
                 }
             }
         }
     }
 }