clean : deleted all useless scripts
This commit is contained in:
@@ -36,6 +36,14 @@ namespace Unheimlich.Features.Player
|
||||
public bool HasActiveLookInput { get; private set; }
|
||||
public bool IsUsingGamepad { get; private set; }
|
||||
|
||||
//Cam headbob mods
|
||||
public enum HeadBobMode
|
||||
{
|
||||
Normal,
|
||||
Idle,
|
||||
Disabled
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
if (Settings != null)
|
||||
|
||||
@@ -24,8 +24,8 @@ namespace Unheimlich.Features.Player
|
||||
// Strafe tilt (Z roll applied in LateUpdate, after OctoPlayer sets camera pitch).
|
||||
private float _currentTilt = 0f;
|
||||
|
||||
private HeadBobMode _overrideMode = HeadBobMode.Normal;
|
||||
private bool _hasOverride = false;
|
||||
private CameraEffects.HeadBobMode _overrideMode = CameraEffects.HeadBobMode.Normal;
|
||||
private bool _hasOverride = false;
|
||||
private Coroutine _resetCoroutine;
|
||||
|
||||
private void Start()
|
||||
@@ -41,17 +41,16 @@ namespace Unheimlich.Features.Player
|
||||
var settings = PlayerController.Instance.CameraEffects?.Settings;
|
||||
if (settings == null) return;
|
||||
|
||||
HeadBobMode currentMode = _hasOverride ? _overrideMode : HeadBobMode.Normal;
|
||||
CameraEffects.HeadBobMode currentMode = _hasOverride ? _overrideMode : CameraEffects.HeadBobMode.Normal;
|
||||
|
||||
if (currentMode == HeadBobMode.Disabled)
|
||||
if (currentMode == CameraEffects.HeadBobMode.Disabled)
|
||||
{
|
||||
SetBobDirect(settings.idleBobSpeed, 0f);
|
||||
ApplySmoothedBob(settings.bobRollAmplitude);
|
||||
return;
|
||||
}
|
||||
|
||||
bool forceIdle = currentMode == HeadBobMode.Idle
|
||||
|| (PlayerInspectionHandler.Instance != null && PlayerInspectionHandler.Instance.IsInspecting);
|
||||
bool forceIdle = currentMode == CameraEffects.HeadBobMode.Idle;
|
||||
|
||||
if (forceIdle)
|
||||
{
|
||||
@@ -119,7 +118,7 @@ namespace Unheimlich.Features.Player
|
||||
// ── Public API ────────────────────────────────────────────────────────────
|
||||
|
||||
/// <summary>Overrides the head bob mode (Idle, Normal, Disabled).</summary>
|
||||
public void SetMode(HeadBobMode mode)
|
||||
public void SetMode(CameraEffects.HeadBobMode mode)
|
||||
{
|
||||
_overrideMode = mode;
|
||||
_hasOverride = true;
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Unheimlich.Features.Player
|
||||
{
|
||||
public class HandTouchFeedback : MonoBehaviour
|
||||
{
|
||||
[Header("Visual Settings")]
|
||||
[SerializeField] private Image _feedbackImage;
|
||||
[SerializeField] private Color _readyColor = Color.green;
|
||||
[SerializeField] private float _pulseSpeed = 2f;
|
||||
[SerializeField] private float _pulseIntensity = 0.3f;
|
||||
|
||||
private float _pulseTimer;
|
||||
private Color _originalColor;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (_feedbackImage != null)
|
||||
{
|
||||
_originalColor = _feedbackImage.color;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
_pulseTimer = 0f;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (_feedbackImage == null)
|
||||
return;
|
||||
|
||||
_pulseTimer += Time.deltaTime * _pulseSpeed;
|
||||
float pulse = (Mathf.Sin(_pulseTimer) + 1f) * 0.5f;
|
||||
|
||||
Color targetColor = Color.Lerp(_originalColor, _readyColor, pulse * _pulseIntensity);
|
||||
_feedbackImage.color = targetColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 39b78978d656e894ea455342398ef8ba
|
||||
@@ -1,105 +0,0 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.Rendering.Universal;
|
||||
using Unheimlich.Core;
|
||||
using Unheimlich.Features.Hallucination;
|
||||
|
||||
namespace Unheimlich.Features.Player
|
||||
{
|
||||
public class ListeningVignetteEffect : Singleton<ListeningVignetteEffect>
|
||||
{
|
||||
[Header("References")]
|
||||
[Tooltip("Dedicated Volume for listening mode (not shared with dialogue system)")]
|
||||
[SerializeField] private Volume _listeningVolume;
|
||||
|
||||
[Header("Settings")]
|
||||
[Tooltip("Target intensity when listening (0-1)")]
|
||||
[SerializeField] [Range(0f, 1f)] private float _targetIntensity = 0.3f;
|
||||
|
||||
[Tooltip("Speed of vignette fade in/out")]
|
||||
[SerializeField] private float _transitionSpeed = 2f;
|
||||
|
||||
private Vignette _vignette;
|
||||
private bool _isEnabled;
|
||||
private VolumeProfile _volumeProfile;
|
||||
|
||||
protected override void OnAwake()
|
||||
{
|
||||
if (_listeningVolume == null)
|
||||
{
|
||||
GameObject volumeObject = new GameObject("Listening Mode Volume");
|
||||
volumeObject.transform.SetParent(transform);
|
||||
_listeningVolume = volumeObject.AddComponent<Volume>();
|
||||
_listeningVolume.isGlobal = true;
|
||||
_listeningVolume.priority = 1;
|
||||
_listeningVolume.weight = 0f;
|
||||
}
|
||||
|
||||
if (_listeningVolume.profile == null)
|
||||
{
|
||||
_volumeProfile = ScriptableObject.CreateInstance<VolumeProfile>();
|
||||
_listeningVolume.profile = _volumeProfile;
|
||||
|
||||
_vignette = _volumeProfile.Add<Vignette>();
|
||||
_vignette.active = true;
|
||||
_vignette.intensity.Override(0f);
|
||||
_vignette.smoothness.Override(0.4f);
|
||||
_vignette.rounded.Override(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!_listeningVolume.profile.TryGet(out _vignette))
|
||||
{
|
||||
_vignette = _listeningVolume.profile.Add<Vignette>();
|
||||
_vignette.active = true;
|
||||
_vignette.intensity.Override(0f);
|
||||
_vignette.smoothness.Override(0.4f);
|
||||
_vignette.rounded.Override(true);
|
||||
}
|
||||
}
|
||||
|
||||
_listeningVolume.weight = 0f;
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (_vignette == null || _listeningVolume == null)
|
||||
return;
|
||||
|
||||
float targetWeight = _isEnabled ? 1f : 0f;
|
||||
_listeningVolume.weight = Mathf.Lerp(_listeningVolume.weight, targetWeight, Time.deltaTime * _transitionSpeed);
|
||||
|
||||
if (_isEnabled)
|
||||
_vignette.intensity.value = _targetIntensity;
|
||||
}
|
||||
|
||||
public void EnableVignette(bool enable)
|
||||
{
|
||||
_isEnabled = enable;
|
||||
|
||||
// Suppress the hallucination vignette while diapason is active to avoid additive blending.
|
||||
// Restores hallucination vignette control when diapason listening ends.
|
||||
if (HallucinationManager.Instance != null)
|
||||
HallucinationManager.Instance.SetVignetteOverriddenExternally(enable);
|
||||
}
|
||||
|
||||
public void SetIntensity(float intensity)
|
||||
{
|
||||
_targetIntensity = Mathf.Clamp01(intensity);
|
||||
if (_vignette != null)
|
||||
_vignette.intensity.value = _targetIntensity;
|
||||
}
|
||||
|
||||
public void EnableVignetteWithIntensity(float intensity)
|
||||
{
|
||||
SetIntensity(intensity);
|
||||
EnableVignette(true);
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
if (_volumeProfile != null)
|
||||
Destroy(_volumeProfile);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 878ebc270c13e5c49a3813b1848f6ea5
|
||||
@@ -4,9 +4,6 @@ using Unheimlich.Core;
|
||||
using Unheimlich.Features.Player.Data;
|
||||
using Unheimlich.Features.Dialogue;
|
||||
using Unheimlich.Core.Interaction;
|
||||
using Unheimlich.Features.DetectiveBoard;
|
||||
using Unheimlich.Features.Diapason;
|
||||
using Unheimlich.Features.OctoArms;
|
||||
using Unheimlich.World.CameraSystem;
|
||||
using InputManager = Unheimlich.Core.Input.InputManager;
|
||||
|
||||
@@ -27,13 +24,6 @@ namespace Unheimlich.Features.Player
|
||||
public Transform CameraTransform { get; private set; }
|
||||
public Transform CameraPivot { get; private set; }
|
||||
public CameraEffects CameraEffects { get; private set; }
|
||||
public CameraPanController CameraPanController { get; private set; }
|
||||
public DiapasonListeningHandlerV2 DiapasonHandler { get; private set; }
|
||||
public DiapasonEquipmentManager DiapasonEquipment { get; private set; }
|
||||
public PlayerInspectionHandler InspectionHandler { get; private set; }
|
||||
public DetectiveBoardController DetectiveBoardController { get; private set; }
|
||||
public OctoIkArmsImproved ArmsSystem { get; private set; }
|
||||
|
||||
public InputManager Inputs => InputManager.Instance;
|
||||
|
||||
// Cached sprint InputAction — resolved once in OnAwake to avoid per-frame foreach.
|
||||
@@ -56,14 +46,8 @@ namespace Unheimlich.Features.Player
|
||||
Movement = GetComponent<OctoPlayer>();
|
||||
CharController = GetComponent<CharacterController>();
|
||||
CameraEffects = GetComponent<CameraEffects>();
|
||||
CameraPanController = GetComponent<CameraPanController>();
|
||||
DiapasonHandler = GetComponent<DiapasonListeningHandlerV2>();
|
||||
DiapasonEquipment = GetComponent<DiapasonEquipmentManager>();
|
||||
InspectionHandler = GetComponent<PlayerInspectionHandler>();
|
||||
DetectiveBoardController = GetComponent<DetectiveBoardController>();
|
||||
|
||||
PlayerCamera = GetComponentInChildren<Camera>();
|
||||
ArmsSystem = GetComponentInChildren<OctoIkArmsImproved>();
|
||||
|
||||
if (PlayerCamera != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user