49 lines
1.5 KiB
C#
49 lines
1.5 KiB
C#
using System;
|
|
using Sirenix.OdinInspector;
|
|
using SLSUtilities.Feedback;
|
|
using UnityEngine;
|
|
|
|
namespace Cielonos.MainGame.Effects.Feedback
|
|
{
|
|
/// <summary>
|
|
/// 径向模糊反馈动作,通过 RadialBlurShakeEvent 触发 RadialBlurShaker。
|
|
/// </summary>
|
|
[Serializable]
|
|
[FeedbackActionColor(0.6f, 0.4f, 0.9f)]
|
|
public class RadialBlurAction : PostprocessingActionBase
|
|
{
|
|
public override string DisplayName => "Radial Blur";
|
|
|
|
public FloatCurveChannel intensityCurve = FloatCurveChannel.CreateDefault(remapMax: 1f);
|
|
|
|
/// <summary>
|
|
/// 是否修改模糊中心点。关闭时保持 Volume 当前设置。
|
|
/// </summary>
|
|
[LabelText("修改中心点")]
|
|
public bool modifyCenter;
|
|
|
|
/// <summary>
|
|
/// 模糊中心的屏幕坐标 (0-1)。(0.5, 0.5) 为屏幕正中心。
|
|
/// </summary>
|
|
[ShowIf("modifyCenter")]
|
|
[LabelText("中心点")]
|
|
public Vector2 center = new Vector2(0.5f, 0.5f);
|
|
|
|
protected override void TriggerEvent(FeedbackContext context)
|
|
{
|
|
RadialBlurShakeEvent.Trigger(context, intensityCurve, modifyCenter, center);
|
|
}
|
|
|
|
protected override void StopEvent(FeedbackContext context)
|
|
{
|
|
RadialBlurShakeEvent.Trigger(context, default, stop: true);
|
|
}
|
|
|
|
public override bool Validate(out string error)
|
|
{
|
|
error = null;
|
|
return true;
|
|
}
|
|
}
|
|
}
|