Fix music loop
This commit is contained in:
@@ -16,11 +16,17 @@ public partial class AreaExit : Node3D
|
||||
|
||||
private void OnExitEntered(Node3D node)
|
||||
{
|
||||
if (node is Character character)
|
||||
{
|
||||
_gameManager.RemoveCharacterAndAddToExit(character.OwnerPlayer);
|
||||
Character incoming = null;
|
||||
if (node is Character nodeCharacter)
|
||||
incoming = nodeCharacter;
|
||||
else if (node.GetParent().GetParent() is Character parentedNode)
|
||||
incoming = parentedNode;
|
||||
|
||||
GD.Print($"Exit reached by {character.Name}");
|
||||
if (incoming != null)
|
||||
{
|
||||
_gameManager.RemoveCharacterAndAddToExit(incoming.OwnerPlayer);
|
||||
|
||||
GD.Print($"Exit reached by {incoming.Name}");
|
||||
|
||||
if (!_gameManager.Players.Any(x => x.CharactersLeftOnStage.Any()))
|
||||
_gameManager.OnLevelClear();
|
||||
|
||||
Reference in New Issue
Block a user