Add detective board
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using UnityEngine;
|
||||
using Unheimlich.Interactions.Core;
|
||||
using Unheimlich.Data.CameraSettings;
|
||||
|
||||
namespace Unheimlich.Gameplay.Player
|
||||
{
|
||||
@@ -21,6 +22,9 @@ namespace Unheimlich.Gameplay.Player
|
||||
private PlayerMovement _playerMovement;
|
||||
private float _timer = 0f;
|
||||
private Vector3 _startLocalPos;
|
||||
|
||||
private HeadBobMode _overrideMode = HeadBobMode.Normal;
|
||||
private bool _hasOverride = false;
|
||||
|
||||
void Start()
|
||||
{
|
||||
@@ -33,7 +37,15 @@ namespace Unheimlich.Gameplay.Player
|
||||
if (_playerMovement == null || _playerMovement.CharacterController == null)
|
||||
return;
|
||||
|
||||
if (PlayerInspectionHandler.Instance != null && PlayerInspectionHandler.Instance.IsInspecting)
|
||||
HeadBobMode currentMode = _hasOverride ? _overrideMode : HeadBobMode.Normal;
|
||||
|
||||
if (currentMode == HeadBobMode.Disabled)
|
||||
{
|
||||
ResetPosition();
|
||||
return;
|
||||
}
|
||||
|
||||
if (currentMode == HeadBobMode.Idle || (PlayerInspectionHandler.Instance != null && PlayerInspectionHandler.Instance.IsInspecting))
|
||||
{
|
||||
ApplyBob(_idleBobSpeed, _idleBobAmplitude);
|
||||
return;
|
||||
@@ -52,6 +64,23 @@ namespace Unheimlich.Gameplay.Player
|
||||
else
|
||||
ResetPosition();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the head bob mode override.
|
||||
/// </summary>
|
||||
public void SetMode(HeadBobMode mode)
|
||||
{
|
||||
_overrideMode = mode;
|
||||
_hasOverride = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clears the override and returns to normal behavior.
|
||||
/// </summary>
|
||||
public void ClearOverride()
|
||||
{
|
||||
_hasOverride = false;
|
||||
}
|
||||
|
||||
private void ApplyBob(float speed, float amplitude)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user