summaryrefslogtreecommitdiff
path: root/scripts/input/InputHandler.cs
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/input/InputHandler.cs')
-rw-r--r--scripts/input/InputHandler.cs8
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/input/InputHandler.cs b/scripts/input/InputHandler.cs
index 873276f..4f5b4e1 100644
--- a/scripts/input/InputHandler.cs
+++ b/scripts/input/InputHandler.cs
@@ -3,7 +3,8 @@ using Godot;
public enum InputHandlers
{
MainGame,
- GameOver
+ GameOver,
+ Inspect
}
/// <summary>
@@ -25,7 +26,8 @@ public partial class InputHandler : Node
inputHandlers.Add(InputHandlers.MainGame, GetNode<MainGameInputHandler>("MainGameInputHandler"));
// Controles para quando o jogador está morto.
inputHandlers.Add(InputHandlers.GameOver, GetNode<GameOverInputHandler>("GameOverInputHandler"));
-
+ inputHandlers.Add(InputHandlers.Inspect, GetNode<InspectInputHandler>("InspectInputHandler"));
+
SetInputHandler(startingInputHandler);
}
@@ -39,6 +41,8 @@ public partial class InputHandler : Node
/// </summary>
/// <param name="inputhandler">Estado do jogo.</param>
public void SetInputHandler(InputHandlers inputhandler) {
+ selectedInputHandler?.Exit();
selectedInputHandler = inputHandlers[inputhandler];
+ selectedInputHandler.Enter();
}
}