using System; using Sirenix.OdinInspector; using SLSUtilities.Feedback; using UnityEngine; namespace Cielonos.MainGame.Effects.Feedback { /// /// AnimeBloom 反馈动作,通过 AnimeBloomShakeEvent 触发 AnimeBloomShaker。 /// 默认驱动 intensity 曲线,可选启用 threshold/scatter/tint 的动画或固定值。 /// [Serializable] [FeedbackActionColor(1f, 0.6f, 0.8f)] public class BloomAction : PostprocessingActionBase { public override string DisplayName => "Anime Bloom"; [LabelText("强度曲线")] public FloatCurveChannel intensityCurve = FloatCurveChannel.CreateDefault(remapMax: 3f); // ─── Threshold ─── [LabelText("修改阈值")] public bool modifyThreshold; [HideIf("modifyThreshold")] [LabelText("阈值")] public float threshold = 1.1f; [ShowIf("modifyThreshold")] [LabelText("阈值曲线")] public FloatCurveChannel thresholdCurve = FloatCurveChannel.CreateDefault(remapMax: 1.1f); // ─── Scatter ─── [LabelText("修改扩散")] public bool modifyScatter; [HideIf("modifyScatter")] [LabelText("扩散半径")] public float scatter = 0.7f; [ShowIf("modifyScatter")] [LabelText("扩散曲线")] public FloatCurveChannel scatterCurve = FloatCurveChannel.CreateDefault(remapMax: 0.7f); // ─── Tint ─── [LabelText("修改染色")] public bool modifyTint; [HideIf("modifyTint")] [LabelText("泛光染色")] public Color tint = Color.white; [ShowIf("modifyTint")] [LabelText("染色曲线")] public ColorCurveChannel tintCurve = ColorCurveChannel.CreateDefault(); protected override void TriggerEvent(FeedbackContext context) { AnimeBloomShakeEvent.Trigger( context, intensityCurve, modifyThreshold, modifyThreshold ? thresholdCurve : default, threshold, modifyScatter, modifyScatter ? scatterCurve : default, scatter, modifyTint, modifyTint ? tintCurve : default, tint ); } protected override void StopEvent(FeedbackContext context) { AnimeBloomShakeEvent.Trigger(context, intensityCurve, stop: true); } public override bool Validate(out string error) { error = null; return true; } } }