57 lines
1.7 KiB
C#
57 lines
1.7 KiB
C#
using System;
|
|
using Sirenix.OdinInspector;
|
|
using SLSUtilities.Feedback;
|
|
using UnityEngine;
|
|
|
|
namespace Cielonos.MainGame.Effects.Feedback
|
|
{
|
|
/// <summary>
|
|
/// 高级色散反馈动作,通过 ChromaticAberrationShakeEvent 触发 ChromaticAberrationShaker。
|
|
/// </summary>
|
|
[Serializable]
|
|
[FeedbackActionColor(0.8f, 0.4f, 0.8f)]
|
|
public class ChromaticAberrationAction : PostprocessingActionBase
|
|
{
|
|
public override string DisplayName => "Chromatic Aberration";
|
|
|
|
public FloatCurveChannel intensityCurve = FloatCurveChannel.CreateDefault(remapMax: 1f);
|
|
|
|
/// <summary>
|
|
/// 是否同时修改中心点。
|
|
/// </summary>
|
|
[LabelText("修改中心点")]
|
|
public bool modifyCenter;
|
|
|
|
[ShowIf("modifyCenter")]
|
|
[LabelText("中心点曲线")]
|
|
public Vector2CurveChannel centerCurve = Vector2CurveChannel.CreateDefault();
|
|
|
|
/// <summary>
|
|
/// 是否同时修改抖动强度。
|
|
/// </summary>
|
|
[LabelText("修改抖动")]
|
|
public bool modifyJitter;
|
|
|
|
[ShowIf("modifyJitter")]
|
|
[LabelText("抖动曲线")]
|
|
public FloatCurveChannel jitterCurve = FloatCurveChannel.CreateDefault(remapMax: 0.5f);
|
|
|
|
protected override void TriggerEvent(FeedbackContext context)
|
|
{
|
|
ChromaticAberrationShakeEvent.Trigger(
|
|
context,
|
|
intensityCurve,
|
|
modifyCenter,
|
|
centerCurve,
|
|
modifyJitter,
|
|
jitterCurve
|
|
);
|
|
}
|
|
|
|
protected override void StopEvent(FeedbackContext context)
|
|
{
|
|
ChromaticAberrationShakeEvent.Trigger(context, intensityCurve, stop: true);
|
|
}
|
|
}
|
|
}
|