100 lines
3.8 KiB
C#
100 lines
3.8 KiB
C#
using System;
|
|
using UnityEngine;
|
|
|
|
namespace AibisDream
|
|
{
|
|
/// <summary>
|
|
/// Central tuning for Peipei eye-module visuals. Edit on EyeManager (EyeSystem).
|
|
/// </summary>
|
|
[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("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("Distortion Pulse")]
|
|
[Tooltip("Peak _DistortAmount during ColorIn / FadeOut.")]
|
|
[Range(0f, 0.08f)] public float colorPulseDistortion = 0.035f;
|
|
|
|
[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("Off by default so you can tune the sight without blinking.")]
|
|
public bool autoBlink;
|
|
|
|
public Vector2 autoBlinkInterval = new(8f, 15f);
|
|
public float blinkCloseDuration = 0.09f;
|
|
public float blinkOpenDuration = 0.14f;
|
|
|
|
[Header("Transition Blink")]
|
|
[Tooltip("聚焦:单次眨眼开眼到该进度时触发变清晰(0=刚睁眼,1=完全睁开)。")]
|
|
[Range(0f, 1f)] 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
|
|
};
|
|
}
|
|
}
|