using System; using UnityEngine; namespace AibisDream { /// /// Central tuning for Peipei eye-module visuals. Edit on EyeManager (EyeSystem). /// [Serializable] public class EyeVisualSettings { [Header("Color Reveal")] [Tooltip("Unfocused / gray state (0 = gray, 1 = full color).")] [Range(0f, 1f)] public float colorRevealMin; [Tooltip("Focused / imagined color state.")] [Range(0f, 1f)] public float colorRevealMax = 1f; [Header("Presentation Speed")] [Tooltip("Eye/UF 演出整体倍速(等待、Tween、眨眼、关联 SFX pitch)。2.5 = 快 2.5 倍。")] [Min(0.01f)] public float presentationSpeed = 2.5f; [Header("Transition Duration (seconds)")] public float imagineColorDuration = 1f; public float cannotImagineDuration = 1f; public float eyeDisorderDuration = 2f; public float canSeeColorDuration = 1f; public float targetSwitchDuration = 1f; [Header("Blur")] [Tooltip("Blur when unfocused or module idle.")] [Range(0f, 1f)] public float idleBlurAmount = 1f; [Tooltip("Blur when focused and sharp.")] [Range(0f, 1f)] public float focusedBlurAmount; [Tooltip("Shader _BlurSize when blur is active.")] [Range(0f, 0.02f)] public float blurSize = 0.008f; [Header("Color Sweep (shader)")] [Tooltip("Width of the directional color sweep during ColorIn/FadeOut.")] [Range(0.001f, 1f)] public float revealWidth = 0.18f; [Tooltip("Sweep direction in radians (0 = left-to-right).")] [Range(0f, 6.28318f)] public float revealRotation; [Range(0f, 1f)] public float revealNoise = 0.08f; [Header("Color Sweep (ColorIn / FadeOut)")] [Tooltip("Light RGB fringe during color sweep; 0 = sweep only.")] [Range(0f, 1f)] public float colorSweepChromaPeak = 0.35f; [Tooltip("Sweep duration fraction to ramp chroma fringe to peak.")] [Range(0.1f, 0.6f)] public float colorSweepChromaRamp = 0.4f; [HideInInspector] public float imagineGlitchPeak = 0.35f; [HideInInspector] public float imagineGlitchRamp = 0.4f; [HideInInspector] public float colorPulseDistortion = 0.06f; [Header("Focus Settle (BlurOut)")] [Tooltip("Mid-phase micro-defocus added on top of focused blur.")] [Range(0f, 0.5f)] public float focusSettleDefocusBump = 0.12f; [Tooltip("Single BlurOut timing split (focus | micro-defocus | refocus). Sum = 1; total seconds unchanged.")] public Vector3 focusSettlePhaseRatios = new(0.5f, 0.22f, 0.28f); [Header("Wrong Color (Eye Disorder)")] public Color wrongColor = new(1f, 0.16f, 0.08f, 1f); [Header("HSV")] [Range(0f, 2f)] public float hsvSaturation = 1f; [Header("Glitch / Memory Wave")] public float glitchInDuration = 1f; public float roundWaveInDuration = 2f; public float roundWaveOutDuration = 0.5f; public float glitchOutDuration = 0.5f; [Header("Viewport Overlay (no post-processing)")] public bool enableViewportOverlay = true; [Tooltip("Horizontal half-size of the resting sight almond (left/right darkness).")] [Range(0.22f, 0.58f)] public float eyeWidth = 0.46f; [Tooltip("Vertical half-size of the resting sight almond (top/bottom darkness).")] [Range(0.15f, 0.72f)] public float eyeHeight = 0.28f; [Tooltip("Softness of the elliptical sight boundary.")] [Range(0.001f, 0.2f)] public float edgeSoftness = 0.022f; [Tooltip("Deprecated: unused. Blink only on imagine FadeIn.")] public bool autoBlink; [HideInInspector] public Vector2 autoBlinkInterval = new(8f, 15f); public float blinkCloseDuration = 0.09f; public float blinkOpenDuration = 0.14f; [Header("Imagine Blink (EyeEffect_FadeIn only)")] [HideInInspector] public float focusEffectAtBlinkOpen = 0.85f; [Tooltip("想象:两次眨眼之间的间隔(秒)。")] public float imagineBlinkGap = 0.04f; [Tooltip("想象:第二次眨眼开眼到该进度时触发上色。")] [Range(0f, 1f)] public float imagineEffectAtBlinkOpen = 1f; public float GetDurationForState(EyeSystem.EyeColorState state) => state switch { EyeSystem.EyeColorState.CanImagineColor => imagineColorDuration, EyeSystem.EyeColorState.CannotImagineColor => cannotImagineDuration, EyeSystem.EyeColorState.EyeDisorder => eyeDisorderDuration, EyeSystem.EyeColorState.CanSeeColor => canSeeColorDuration, _ => imagineColorDuration }; } }