81 lines
2.9 KiB
C#
81 lines
2.9 KiB
C#
using UnityEngine;
|
|
|
|
namespace Unheimlich.World.CameraSystem
|
|
{
|
|
/// <summary>
|
|
/// Camera pan mode.
|
|
/// </summary>
|
|
public enum CameraPanMode
|
|
{
|
|
Pan,
|
|
FreeLook
|
|
}
|
|
|
|
/// <summary>
|
|
/// Head bob mode for camera pan.
|
|
/// </summary>
|
|
public enum HeadBobMode
|
|
{
|
|
Normal,
|
|
Idle,
|
|
Disabled
|
|
}
|
|
|
|
/// <summary>
|
|
/// ScriptableObject configuration for camera pan and player alignment behavior.
|
|
/// Defines pan speed, borders, angles, alignment parameters, and lerp smoothness.
|
|
/// </summary>
|
|
[CreateAssetMenu(fileName = "CameraPanSettings", menuName = "Unheimlich/Camera/Camera Pan Settings")]
|
|
public class CameraPanSettings : ScriptableObject
|
|
{
|
|
[Header("Pan Mode")]
|
|
[Tooltip("Pan: Smooth edge-based panning for object inspection | FreeLook: Direct mouse/stick control for detective board")]
|
|
public CameraPanMode PanMode = CameraPanMode.Pan;
|
|
|
|
[Header("Camera Pan")]
|
|
[Tooltip("Camera pan speed when moving the cursor/look stick")]
|
|
public float PanSpeed = 2f;
|
|
|
|
[Tooltip("Size of the border area for mouse pan (0-1, screen percentage)")]
|
|
[Range(0f, 0.5f)]
|
|
public float PanBorderSize = 0.1f;
|
|
|
|
[Tooltip("Maximum horizontal angle the camera can pan from center (left/right)")]
|
|
public float MaxPanAngleX = 15f;
|
|
|
|
[Tooltip("Maximum vertical angle the camera can pan from center (up/down)")]
|
|
public float MaxPanAngleY = 15f;
|
|
|
|
[Header("Recentering")]
|
|
[Tooltip("Enable automatic return to center when idle")]
|
|
public bool EnableRecentering = true;
|
|
|
|
[Tooltip("Speed of automatic recentering (higher = faster return to center)")]
|
|
public float RecenterSpeed = 2f;
|
|
|
|
[Tooltip("Delay before recentering starts (in seconds)")]
|
|
public float RecenterDelay = 0.1f;
|
|
|
|
[Header("Player Alignment")]
|
|
[Tooltip("Speed of player/camera alignment to target")]
|
|
public float AlignmentSpeed = 3f;
|
|
|
|
[Tooltip("Threshold for alignment completion")]
|
|
public float AlignmentThreshold = 0.5f;
|
|
|
|
[Tooltip("Fixed distance from the player to the target when aligning (in meters)")]
|
|
public float FixedDistanceFromTarget = 1.5f;
|
|
|
|
[Header("Head Bob Control")]
|
|
[Tooltip("Head bob mode: Normal (default behavior), Idle (force subtle breathing), Disabled (no movement)")]
|
|
public HeadBobMode HeadBobMode = HeadBobMode.Idle;
|
|
|
|
[Header("Lerp Smoothing")]
|
|
[Tooltip("Use SmoothStep for smoother interpolation (true) or linear lerp (false)")]
|
|
public bool UseSmoothStep = true;
|
|
|
|
[Tooltip("Custom animation curve for alignment (overrides SmoothStep if set)")]
|
|
public AnimationCurve AlignmentCurve = null;
|
|
}
|
|
}
|