This commit is contained in:
Marco 2025-06-18 18:09:30 +02:00
commit 341f76d885
17 changed files with 156 additions and 55 deletions

View file

@ -47,7 +47,7 @@ public partial class KeyboardInputProvider : InputProvider
private void DelayedRegisterGameManager()
{
_mouseAImProvider = GetNodeOrNull<IMouseAimProvider>("MouseAimProvider");
_mouseAImProvider = this.GetParent().GetNodeOrNull<IMouseAimProvider>("MouseAimProvider");
if (_mouseAImProvider is null)
{
@ -57,10 +57,18 @@ public partial class KeyboardInputProvider : InputProvider
if (GameManager.Instance is null)
{
GD.Print("No GameManager found for keyboard inputprovider");
return;
}
else
{
GameManager.Instance.GameStateChange += InstanceOnGameStateChange;
}
GameManager.Instance.GameStateChange += InstanceOnGameStateChange;
if (GameController.Instance is not null)
{
GameController.Instance.GameStateChange += InstanceOnGameStateChange;
}
_enabled = true;
}