From 5d2da3ddbfcdfaf54009815abed09af242df45d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerard=20Gasc=C3=B3n?= <52170489+GerardGascon@users.noreply.github.com> Date: Sun, 14 Apr 2024 18:53:13 +0200 Subject: [PATCH] refactor: removed unnecessary input reading code --- Assets/Scripts/Domain/Input/InputReader.cs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Assets/Scripts/Domain/Input/InputReader.cs b/Assets/Scripts/Domain/Input/InputReader.cs index 2f38bf8..82323d0 100644 --- a/Assets/Scripts/Domain/Input/InputReader.cs +++ b/Assets/Scripts/Domain/Input/InputReader.cs @@ -7,13 +7,7 @@ public void UpdateInput() { _wasPressed = _isPressed; - short keyState = Win32API.GetAsyncKeyState(Key); - - if (_wasPressed && keyState == 0) { - _isPressed = false; - }else if (!_isPressed && keyState != 0) { - _isPressed = true; - } + _isPressed = Win32API.GetAsyncKeyState(Key) != 0; } public bool KeyDown() => _isPressed && !_wasPressed;