2026-04-18 13:57:19 -04:00
|
|
|
using System;
|
|
|
|
|
using Sirenix.OdinInspector;
|
|
|
|
|
using SLSUtilities.Feedback;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
namespace Cielonos.MainGame.Effects.Feedback
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 高级暗角反馈动作,通过 VignetteShakeEvent 触发 VignetteShaker。
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Serializable]
|
|
|
|
|
[FeedbackActionColor(0.9f, 0.5f, 0.3f)]
|
|
|
|
|
public class VignetteAction : PostprocessingActionBase
|
|
|
|
|
{
|
|
|
|
|
public override string DisplayName => "Vignette";
|
|
|
|
|
|
|
|
|
|
public FloatCurveChannel intensityCurve = FloatCurveChannel.CreateDefault(remapMax: 1f);
|
|
|
|
|
|
|
|
|
|
[LabelText("修改中心点")]
|
|
|
|
|
public bool modifyCenter;
|
|
|
|
|
|
|
|
|
|
[HideIf("modifyCenter")]
|
|
|
|
|
[LabelText("中心点")]
|
|
|
|
|
public Vector2 center = new Vector2(0.5f, 0.5f);
|
|
|
|
|
|
|
|
|
|
[ShowIf("modifyCenter")]
|
2026-04-28 15:46:32 -04:00
|
|
|
[LabelText("中心点曲线")]
|
2026-04-18 13:57:19 -04:00
|
|
|
public Vector2CurveChannel centerCurve = Vector2CurveChannel.CreateDefault();
|
|
|
|
|
|
|
|
|
|
[LabelText("修改颜色")]
|
|
|
|
|
public bool modifyColors;
|
|
|
|
|
|
|
|
|
|
[HideIf("modifyColors")]
|
2026-04-28 15:46:32 -04:00
|
|
|
[LabelText("外圈颜色")]
|
|
|
|
|
public Color outColor = Color.black;
|
2026-04-18 13:57:19 -04:00
|
|
|
|
2026-04-28 15:46:32 -04:00
|
|
|
[HideIf("modifyColors")]
|
|
|
|
|
[LabelText("内圈颜色")]
|
|
|
|
|
public Color innerColor = Color.black;
|
2026-04-18 13:57:19 -04:00
|
|
|
|
|
|
|
|
[ShowIf("modifyColors")]
|
2026-04-28 15:46:32 -04:00
|
|
|
[LabelText("外圈颜色曲线")]
|
2026-04-18 13:57:19 -04:00
|
|
|
public ColorCurveChannel outerColorCurve = ColorCurveChannel.CreateDefault();
|
|
|
|
|
|
|
|
|
|
[ShowIf("modifyColors")]
|
2026-04-28 15:46:32 -04:00
|
|
|
[LabelText("内圈颜色曲线")]
|
2026-04-18 13:57:19 -04:00
|
|
|
public ColorCurveChannel innerColorCurve = ColorCurveChannel.CreateDefault();
|
|
|
|
|
|
|
|
|
|
[LabelText("修改形状")]
|
|
|
|
|
public bool modifyShape;
|
|
|
|
|
|
|
|
|
|
[HideIf("modifyShape")]
|
2026-04-28 15:46:32 -04:00
|
|
|
[LabelText("柔和度")]
|
|
|
|
|
public float smoothness = 0.5f;
|
2026-04-18 13:57:19 -04:00
|
|
|
|
|
|
|
|
[HideIf("modifyShape")]
|
2026-04-28 15:46:32 -04:00
|
|
|
[LabelText("圆度")]
|
|
|
|
|
public float roundness = 1f;
|
2026-04-18 13:57:19 -04:00
|
|
|
|
|
|
|
|
[ShowIf("modifyShape")]
|
|
|
|
|
[LabelText("柔和度曲线")]
|
|
|
|
|
public FloatCurveChannel smoothnessCurve = FloatCurveChannel.CreateDefault(remapMax: 0.5f);
|
|
|
|
|
|
|
|
|
|
[ShowIf("modifyShape")]
|
|
|
|
|
[LabelText("圆度曲线")]
|
|
|
|
|
public FloatCurveChannel roundnessCurve = FloatCurveChannel.CreateDefault(remapMax: 1f);
|
|
|
|
|
|
|
|
|
|
protected override void TriggerEvent(FeedbackContext context)
|
|
|
|
|
{
|
|
|
|
|
VignetteShakeEvent.Trigger(
|
|
|
|
|
context,
|
|
|
|
|
intensityCurve,
|
|
|
|
|
modifyCenter,
|
2026-04-28 15:46:32 -04:00
|
|
|
modifyCenter ? centerCurve : default,
|
|
|
|
|
modifyCenter ? center : default(Vector2),
|
2026-04-18 13:57:19 -04:00
|
|
|
modifyColors,
|
2026-04-28 15:46:32 -04:00
|
|
|
modifyColors ? outerColorCurve : default,
|
|
|
|
|
modifyColors ? innerColorCurve : default,
|
|
|
|
|
modifyColors ? outColor : default,
|
|
|
|
|
modifyColors ? innerColor : default,
|
2026-04-18 13:57:19 -04:00
|
|
|
modifyShape,
|
2026-04-28 15:46:32 -04:00
|
|
|
modifyShape ? smoothnessCurve : default,
|
|
|
|
|
modifyShape ? roundnessCurve : default,
|
|
|
|
|
modifyShape ? smoothness : 0f,
|
|
|
|
|
modifyShape ? roundness : 0f
|
2026-04-18 13:57:19 -04:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void StopEvent(FeedbackContext context)
|
|
|
|
|
{
|
|
|
|
|
VignetteShakeEvent.Trigger(context, intensityCurve, stop: true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override bool Validate(out string error)
|
|
|
|
|
{
|
|
|
|
|
error = null;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|