|
|
@ -177,12 +177,13 @@ public class GameManager : MonoBehaviour |
|
|
|
gameMode.PlayerKilled(player); |
|
|
|
} |
|
|
|
|
|
|
|
playerDataAsArray.ForEach(p => p.client.SendLives()); //Update the players score
|
|
|
|
|
|
|
|
|
|
|
|
//Let GameMode know that Round is Over
|
|
|
|
yield return StartCoroutine(EnvironmentEnd()); |
|
|
|
gameMode.RoundEnd(playerDataAsArray.ToArray()); |
|
|
|
|
|
|
|
playerDataAsArray.ForEach(p => p.client.SendLives()); //Update the players score
|
|
|
|
|
|
|
|
//check is anyone has 0 lives remaining
|
|
|
|
//remove them from the array
|
|
|
@ -210,8 +211,9 @@ public class GameManager : MonoBehaviour |
|
|
|
} |
|
|
|
|
|
|
|
playerData = playerData.OrderBy(unit => unit.Value.character.CurrentBlock.transform.position.x).ToDictionary(unit => unit.Key, unit => unit.Value); |
|
|
|
Dictionary<int,PlayerData> filteredPlayers = playerData.Where(p => !p.Value.isDead).ToDictionary(unit => unit.Key, unit => unit.Value); |
|
|
|
int order = 1; |
|
|
|
foreach (PlayerData data in playerDataAsArray) |
|
|
|
foreach (PlayerData data in filteredPlayers.Values) |
|
|
|
{ |
|
|
|
data.character.runOrder = order; |
|
|
|
order++; |
|
|
|