Bezi回来了
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
using System;
|
||||
using Sirenix.OdinInspector;
|
||||
using SLSUtilities.Feedback;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Cielonos.MainGame.Effects.Feedback
|
||||
{
|
||||
/// <summary>
|
||||
/// RGB分离故障反馈动作,通过 RGBSplitGlitchShakeEvent 触发 RGBSplitGlitchShaker。
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[FeedbackActionColor(1f, 0.3f, 0.8f)]
|
||||
public class RGBSplitGlitchAction : PostprocessingActionBase
|
||||
{
|
||||
public override string DisplayName => "RGB Split Glitch";
|
||||
|
||||
[LabelText("强度曲线")]
|
||||
public FloatCurveChannel intensityCurve = FloatCurveChannel.CreateDefault(remapMax: 1f);
|
||||
|
||||
[LabelText("修改速度")]
|
||||
public bool modifySpeed;
|
||||
|
||||
[ShowIf("modifySpeed")]
|
||||
[LabelText("速度曲线")]
|
||||
public FloatCurveChannel speedCurve = FloatCurveChannel.CreateDefault(remapMax: 50f);
|
||||
|
||||
[HideIf("modifySpeed")]
|
||||
[LabelText("速度")]
|
||||
[Range(0f, 100f)]
|
||||
public float speed = 30f;
|
||||
|
||||
protected override void TriggerEvent(FeedbackContext context)
|
||||
{
|
||||
FloatCurveChannel finalSpeedCurve = modifySpeed
|
||||
? speedCurve
|
||||
: new FloatCurveChannel
|
||||
{
|
||||
curve = AnimationCurve.Constant(0f, 1f, speed),
|
||||
relativeToInitial = false
|
||||
};
|
||||
|
||||
RGBSplitGlitchShakeEvent.Trigger(
|
||||
context,
|
||||
intensityCurve,
|
||||
finalSpeedCurve
|
||||
);
|
||||
}
|
||||
|
||||
protected override void StopEvent(FeedbackContext context)
|
||||
{
|
||||
RGBSplitGlitchShakeEvent.Trigger(context, intensityCurve, stop: true);
|
||||
}
|
||||
|
||||
public override bool Validate(out string error)
|
||||
{
|
||||
error = null;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user