125 lines
4.1 KiB
C#
125 lines
4.1 KiB
C#
using UnityEngine;
|
|
|
|
namespace Unheimlich.Data.Dialogues
|
|
{
|
|
/// <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;
|
|
|
|
[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;
|
|
|
|
[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;
|
|
}
|
|
|
|
public enum ChoiceSpawnMode
|
|
{
|
|
AroundAnchor,
|
|
AtAnchorPosition,
|
|
InFrontOfPlayer,
|
|
CircleAroundPlayer
|
|
}
|
|
|
|
public enum RotationAxis
|
|
{
|
|
Forward,
|
|
Up,
|
|
Right
|
|
}
|
|
}
|