Outsourcing of the camera pan system

This commit is contained in:
2026-02-04 16:58:43 +01:00
parent 71c44eb39e
commit 85bf743cba
21 changed files with 2860 additions and 212 deletions
@@ -0,0 +1,37 @@
using UnityEngine;
namespace Unheimlich.Data.CameraSettings
{
/// <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("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 angle the camera can pan from center")]
public float MaxPanAngle = 15f;
[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;
[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;
}
}