Files
Ipseity-Demo/Assets/_Content/Scripts/Features/Dialogue/Data/DialogueAnimationSettings.cs
T

183 lines
6.5 KiB
C#

using UnityEngine;
namespace Unheimlich.Features.Dialogue.Data
{
/// <summary>
/// ScriptableObject configuration for dialogue choice spawn behavior and animations.
/// Defines spawn patterns, floating effects, rotation, distance scaling, and focus behavior.
/// </summary>
[CreateAssetMenu(fileName = "DialogueAnimationSettings", menuName = "Unheimlich/Animation/Dialogue Animation Settings")]
public class DialogueAnimationSettings : ScriptableObject
{
[Header("Choice Spawn Animation")]
[Tooltip("How choices appear in the world")]
public ChoiceSpawnMode SpawnMode = ChoiceSpawnMode.AroundAnchor;
[Tooltip("Default scale multiplier for spawned choices (1.0 = normal size)")]
public float DefaultScaleMultiplier = 1.0f;
[Tooltip("Minimum scale variation multiplier (e.g., 0.5 = 50% of base scale)")]
[Range(0.1f, 2f)]
public float MinScaleVariation = 0.5f;
[Tooltip("Maximum scale variation multiplier (e.g., 1.5 = 150% of base scale)")]
[Range(0.1f, 2f)]
public float MaxScaleVariation = 1.5f;
[Tooltip("Enable random scale variation for each word")]
public bool EnableScaleVariation = false;
[Header("Spawn Settings")]
[Tooltip("Radius around anchor where choices spawn")]
public float SpawnRadius = 2f;
[Tooltip("Height offset from anchor")]
public float SpawnHeightOffset = 0f;
[Tooltip("Should choices face the player?")]
public bool FacePlayer = true;
[Header("Animation")]
[Tooltip("Duration of spawn animation")]
public float SpawnAnimationDuration = 0.5f;
[Tooltip("Spawn animation curve")]
public AnimationCurve SpawnCurve = AnimationCurve.EaseInOut(0, 0, 1, 1);
[Header("Idle Behavior")]
[Tooltip("Should choices float vertically?")]
public bool EnableFloating = true;
[Tooltip("Floating amplitude")]
public float FloatingAmplitude = 0.2f;
[Tooltip("Floating duration (full cycle)")]
public float FloatingDuration = 3f;
[Header("Organic Shake")]
[Tooltip("Enable organic shake/drift movement around center point (Heavy Rain style)")]
public bool EnableOrganicShake = false;
[Tooltip("Radius around center point where choices can drift")]
public float ShakeRadius = 0.15f;
[Tooltip("Speed of the shake movement")]
public float ShakeSpeed = 1.5f;
[Tooltip("Smoothness of shake transitions (higher = smoother)")]
public float ShakeSmoothness = 2f;
[Tooltip("Shake speed multiplier for unfocused choices when one is focused (0.3 = 30% speed)")]
[Range(0f, 1f)]
public float UnfocusedShakeSpeedMultiplier = 0.3f;
[Header("Ghost Trail Effect")]
[Tooltip("Enable ghost/shadow trail effect behind text (Heavy Rain style)")]
public bool EnableGhostTrail = false;
[Tooltip("Time delay for ghost trail in seconds (how far behind the ghost follows)")]
public float GhostTrailDelay = 0.15f;
[Tooltip("Transparency of the ghost trail (0 = invisible, 1 = opaque)")]
[Range(0f, 1f)]
public float GhostTrailAlpha = 0.3f;
[Tooltip("Should container rotate continuously?")]
public bool EnableRotation = true;
[Tooltip("Axis of rotation (Forward = Z, Up = Y, Right = X)")]
public RotationAxis RotationAxis = RotationAxis.Forward;
[Tooltip("Normal rotation speed when not focused (degrees per second). Higher = faster rotation.")]
public float NormalRotationSpeed = 36f;
[Header("Follow Player")]
[Tooltip("Should container follow player position?")]
public bool FollowPlayerPosition = false;
[Tooltip("Should container follow player Y rotation? (keeps choices in front of player)")]
public bool FollowPlayerRotation = false;
[Header("Distance-Based Scaling")]
[Tooltip("Should scale and radius adjust based on distance to player?")]
public bool EnableDistanceScaling = false;
[Tooltip("Minimum distance for scaling calculation")]
public float MinDistance = 2f;
[Tooltip("Maximum distance for scaling calculation")]
public float MaxDistance = 10f;
[Tooltip("Scale multiplier at minimum distance")]
public float MinScaleMultiplier = 1f;
[Tooltip("Scale multiplier at maximum distance")]
public float MaxScaleMultiplier = 3f;
[Header("Focus Animation")]
[Tooltip("Should choices move toward player when focused?")]
public bool MoveTowardPlayerOnFocus = true;
[Tooltip("Distance from player when focused")]
public float FocusDistanceFromPlayer = 1.5f;
[Tooltip("Rotation speed when a choice is focused (degrees per second). Higher = faster rotation.")]
public float FocusRotationSpeed = 60f;
[Tooltip("Enable camera shake when focusing on a choice")]
public bool EnableCameraShakeOnFocus = true;
[Tooltip("Camera shake intensity when focusing (higher = less shake, lower = more shake)")]
public float CameraShakeIntensity = 30f;
[Tooltip("Camera shake smoothness (0 = instant/jarring, higher = smoother). Controls how fast the camera moves to shake position.")]
public float CameraShakeSmoothness = 10f;
[Tooltip("Scale down multiplier for the FOCUSED choice text (0.9 = 90% size)")]
[Range(0f, 1f)]
public float FocusedTextScaleMultiplier = 0.9f;
[Tooltip("Duration of the text scale animation when focusing (in seconds)")]
public float FocusedTextScaleDuration = 0.3f;
[Tooltip("Duration of the text scale reset animation when unfocusing (in seconds)")]
public float UnfocusedTextScaleDuration = 0.3f;
[Header("Sketch & Fade on Selection")]
[Tooltip("Enable sketch and fade effect on non-selected words when a choice is focused")]
public bool EnableSketchFadeOnFocus = false;
[Tooltip("Material with sketch shader for TextMeshPro")]
public Material SketchMaterial;
[Tooltip("Duration of the sketch effect before fade (in seconds)")]
public float SketchDuration = 0.3f;
[Tooltip("Duration of the fade out after sketch (in seconds)")]
public float FadeOutDuration = 0.5f;
[Tooltip("Intensity of the sketch effect (0 = no sketch, 1 = full sketch)")]
[Range(0f, 1f)]
public float SketchIntensity = 0.8f;
[Tooltip("Final alpha value after fade (0 = invisible, 1 = opaque)")]
[Range(0f, 1f)]
public float FinalFadeAlpha = 0.2f;
}
public enum ChoiceSpawnMode
{
AroundAnchor,
AtAnchorPosition,
InFrontOfPlayer,
CircleAroundPlayer
}
public enum RotationAxis
{
Forward,
Up,
Right
}
}