diff options
Diffstat (limited to 'Assets/Scripts/InputHandler.cs')
| -rw-r--r-- | Assets/Scripts/InputHandler.cs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Assets/Scripts/InputHandler.cs b/Assets/Scripts/InputHandler.cs index ec72656..f653adb 100644 --- a/Assets/Scripts/InputHandler.cs +++ b/Assets/Scripts/InputHandler.cs @@ -14,10 +14,27 @@ namespace DS public float mouseY; private PlayerControls _inputActions; + private CameraHandler _cameraHandler; private Vector2 _movementInput; private Vector2 _cameraInput; + private void Awake() + { + _cameraHandler = CameraHandler.singleton; + } + + private void FixedUpdate() + { + float delta = Time.fixedDeltaTime; + + if (_cameraHandler != null) + { + _cameraHandler.FollowTarget(delta); + _cameraHandler.HandleCameraRotation(delta,mouseX,mouseY); + } + } + public void OnEnable() { if (_inputActions == null) @@ -48,6 +65,7 @@ namespace DS moveAmount = Mathf.Clamp01(Mathf.Abs((horizontal)) + Mathf.Abs(vertical)); mouseX = _cameraInput.x; mouseY = _cameraInput.y; + } } } |
