Add utils + refacto

This commit is contained in:
2026-01-30 17:39:26 +01:00
parent 9ff17b5305
commit 23d3cb5d2c
29 changed files with 675 additions and 461 deletions
@@ -1,5 +1,6 @@
using UnityEngine;
using UnityEngine.InputSystem;
using Unheimlich.Core;
using Unheimlich.Gameplay.Player;
namespace Unheimlich.Managers
@@ -10,7 +11,7 @@ namespace Unheimlich.Managers
/// Supports different input contexts (Normal, Dialogue, Listening) to control which inputs are active.
/// </summary>
[RequireComponent(typeof(PlayerInput))]
public class PlayerInputManager : MonoBehaviour
public class PlayerInputManager : Singleton<PlayerInputManager>
{
/// <summary>
/// Defines different input contexts that control which player actions are enabled.
@@ -22,8 +23,6 @@ namespace Unheimlich.Managers
Listening // Only look enabled, movement disabled (for diapason camera pan)
}
public static PlayerInputManager Instance { get; private set; }
[Header("Input Values (Read only)")]
public Vector2 MoveInput;
public Vector2 LookInput;
@@ -44,15 +43,8 @@ namespace Unheimlich.Managers
private PlayerLook _playerLook;
private CameraHeadBob _headBob;
private void Awake()
protected override void OnAwake()
{
if (Instance != null && Instance != this)
{
Destroy(this);
return;
}
Instance = this;
IsInputEnabled = true;
PlayerInput playerInput = GetComponent<PlayerInput>();