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,14 +1,18 @@
using System.Collections;
using UnityEngine;
using UnityEngine.InputSystem;
using Unheimlich.Core;
using Unheimlich.Gameplay.Items;
using InputManager = Unheimlich.Managers.PlayerInputManager;
namespace Unheimlich.Interactions.Core
{
public class PlayerInspectionHandler : MonoBehaviour
/// <summary>
/// Handles player item inspection mode.
/// When inspecting, disables player movement and allows item rotation using look input.
/// </summary>
public class PlayerInspectionHandler : Singleton<PlayerInspectionHandler>
{
public static PlayerInspectionHandler Instance { get; private set; }
[Header("Components")]
[SerializeField] private Transform _inspectionHoldPoint;
@@ -19,21 +23,7 @@ namespace Unheimlich.Interactions.Core
private Coroutine _interactionListener;
private bool _isUsingGamepad = false;
private void Awake()
{
if (Instance != null && Instance != this)
{
Destroy(this);
return;
}
Instance = this;
}
/// <summary>
/// Toggles inspection mode for an item. When inspecting, disables player movement
/// and allows item rotation using look input until interaction key is pressed again.
/// </summary>
public void ToggleInspection(InspectableItem item)
{
if (!IsInspecting)