|
@ -177,12 +177,13 @@ public class GameManager : MonoBehaviour |
|
|
gameMode.PlayerKilled(player); |
|
|
gameMode.PlayerKilled(player); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
playerDataAsArray.ForEach(p => p.client.SendLives()); //Update the players score
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Let GameMode know that Round is Over
|
|
|
//Let GameMode know that Round is Over
|
|
|
yield return StartCoroutine(EnvironmentEnd()); |
|
|
yield return StartCoroutine(EnvironmentEnd()); |
|
|
gameMode.RoundEnd(playerDataAsArray.ToArray()); |
|
|
gameMode.RoundEnd(playerDataAsArray.ToArray()); |
|
|
|
|
|
|
|
|
|
|
|
playerDataAsArray.ForEach(p => p.client.SendLives()); //Update the players score
|
|
|
|
|
|
|
|
|
//check is anyone has 0 lives remaining
|
|
|
//check is anyone has 0 lives remaining
|
|
|
//remove them from the array
|
|
|
//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); |
|
|
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; |
|
|
int order = 1; |
|
|
foreach (PlayerData data in playerDataAsArray) |
|
|
|
|
|
|
|
|
foreach (PlayerData data in filteredPlayers.Values) |
|
|
{ |
|
|
{ |
|
|
data.character.runOrder = order; |
|
|
data.character.runOrder = order; |
|
|
order++; |
|
|
order++; |
|
|