Fix game over
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Godot;
|
||||
using Godot.Collections;
|
||||
using System.Linq;
|
||||
|
||||
public partial class StageGUI : Control
|
||||
@@ -16,7 +17,7 @@ public partial class StageGUI : Control
|
||||
[Signal]
|
||||
public delegate void OnPlayerGameOverEventHandler(Player player);
|
||||
[Signal]
|
||||
public delegate void OnGameOverEventHandler();
|
||||
public delegate void OnGameOverEventHandler(Array<Player> players);
|
||||
|
||||
private GameManager _gameManager;
|
||||
|
||||
@@ -65,9 +66,9 @@ public partial class StageGUI : Control
|
||||
EmitSignal(SignalName.OnPlayerGameOver, player);
|
||||
}
|
||||
|
||||
if (_gameManager.Players.All(x => x.GameOver))
|
||||
if (!_gameManager.IsGameOverScreenOn && _gameManager.Players.All(x => x.GameOver))
|
||||
{
|
||||
EmitSignal(SignalName.OnGameOver);
|
||||
EmitSignal(SignalName.OnGameOver, new Array<Player>(_gameManager.Players));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user