Add utils + refacto
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user