update map gen
This commit is contained in:
@@ -18,18 +18,20 @@ public class GameManager : NetworkBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
public void TriggerGameOver() {
|
||||
[SerializeField] private Hallucinate.Network.MatchEloManager eloManager;
|
||||
|
||||
public void TriggerGameOver(PlayerRef winner, PlayerRef loser, bool isDraw = false) {
|
||||
if (!isGameOver) {
|
||||
// Mark the game as over
|
||||
isGameOver = true;
|
||||
|
||||
if (gameOverText != null) {
|
||||
// Display the Game Over text
|
||||
gameOverText.gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
// Freeze the game by setting the time scale to 0
|
||||
Time.timeScale = 0;
|
||||
// Only Host processes Elo
|
||||
if (Runner.IsServer && eloManager != null) {
|
||||
eloManager.ProcessMatchResult(winner, loser, isDraw);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user