Bezi回来了
This commit is contained in:
@@ -19,13 +19,18 @@ namespace Cielonos.MainGame.Effects.Feedback
|
||||
FeedbackContext feedbackContext,
|
||||
FloatCurveChannel intensityCurve,
|
||||
bool modifyCenter,
|
||||
Vector2CurveChannel centerCurve,
|
||||
Vector2 center,
|
||||
bool modifyColors,
|
||||
ColorCurveChannel colorOuter,
|
||||
ColorCurveChannel colorInner,
|
||||
Color outColor,
|
||||
Color innerColor,
|
||||
bool modifyShape,
|
||||
FloatCurveChannel smoothnessCurve,
|
||||
FloatCurveChannel roundnessCurve,
|
||||
float smoothness,
|
||||
float roundness,
|
||||
bool stop
|
||||
);
|
||||
|
||||
@@ -36,18 +41,23 @@ namespace Cielonos.MainGame.Effects.Feedback
|
||||
FeedbackContext feedbackContext,
|
||||
FloatCurveChannel intensityCurve,
|
||||
bool modifyCenter = false,
|
||||
Vector2CurveChannel centerCurve = default,
|
||||
Vector2 center = default,
|
||||
bool modifyColors = false,
|
||||
ColorCurveChannel colorOuter = default,
|
||||
ColorCurveChannel colorInner = default,
|
||||
Color outColor = default,
|
||||
Color innerColor = default,
|
||||
bool modifyShape = false,
|
||||
FloatCurveChannel smoothnessCurve = default,
|
||||
FloatCurveChannel roundnessCurve = default,
|
||||
float smoothness = 0f,
|
||||
float roundness = 0f,
|
||||
bool stop = false)
|
||||
{
|
||||
OnEvent?.Invoke(feedbackContext, intensityCurve, modifyCenter, center,
|
||||
modifyColors, colorOuter, colorInner, modifyShape,
|
||||
smoothnessCurve, roundnessCurve, stop);
|
||||
OnEvent?.Invoke(feedbackContext, intensityCurve, modifyCenter, centerCurve, center,
|
||||
modifyColors, colorOuter, colorInner, outColor, innerColor, modifyShape,
|
||||
smoothnessCurve, roundnessCurve, smoothness, roundness, stop);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,36 +68,51 @@ namespace Cielonos.MainGame.Effects.Feedback
|
||||
{
|
||||
public readonly FloatCurveChannel intensityCurve;
|
||||
public readonly bool modifyCenter;
|
||||
public readonly Vector2CurveChannel centerCurve;
|
||||
public readonly Vector2 center;
|
||||
public readonly bool modifyColors;
|
||||
public readonly ColorCurveChannel colorOuter;
|
||||
public readonly ColorCurveChannel colorInner;
|
||||
public readonly Color outColor;
|
||||
public readonly Color innerColor;
|
||||
public readonly bool modifyShape;
|
||||
public readonly FloatCurveChannel smoothnessCurve;
|
||||
public readonly FloatCurveChannel roundnessCurve;
|
||||
public readonly float smoothness;
|
||||
public readonly float roundness;
|
||||
|
||||
public VignetteShakeInstance(
|
||||
FeedbackContext feedbackContext,
|
||||
FloatCurveChannel intensityCurve,
|
||||
bool modifyCenter,
|
||||
Vector2CurveChannel centerCurve,
|
||||
Vector2 center,
|
||||
bool modifyColors,
|
||||
ColorCurveChannel colorOuter,
|
||||
ColorCurveChannel colorInner,
|
||||
Color outColor,
|
||||
Color innerColor,
|
||||
bool modifyShape,
|
||||
FloatCurveChannel smoothnessCurve,
|
||||
FloatCurveChannel roundnessCurve)
|
||||
FloatCurveChannel roundnessCurve,
|
||||
float smoothness,
|
||||
float roundness)
|
||||
: base(feedbackContext.timeSettings, feedbackContext.player.TimeProvider, feedbackContext.duration)
|
||||
{
|
||||
this.intensityCurve = intensityCurve;
|
||||
this.modifyCenter = modifyCenter;
|
||||
this.centerCurve = centerCurve;
|
||||
this.center = center;
|
||||
this.modifyColors = modifyColors;
|
||||
this.colorOuter = colorOuter;
|
||||
this.colorInner = colorInner;
|
||||
this.outColor = outColor;
|
||||
this.innerColor = innerColor;
|
||||
this.modifyShape = modifyShape;
|
||||
this.smoothnessCurve = smoothnessCurve;
|
||||
this.roundnessCurve = roundnessCurve;
|
||||
this.smoothness = smoothness;
|
||||
this.roundness = roundness;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,37 +173,44 @@ namespace Cielonos.MainGame.Effects.Feedback
|
||||
|
||||
float normalizedTime = shake.timer / shake.duration;
|
||||
|
||||
if (shake.intensityCurve.active)
|
||||
float curveValue = shake.intensityCurve.Evaluate(normalizedTime);
|
||||
if (shake.intensityCurve.relativeToInitial)
|
||||
{
|
||||
float curveValue = shake.intensityCurve.Evaluate(normalizedTime);
|
||||
if (shake.intensityCurve.relativeToInitial)
|
||||
{
|
||||
additiveIntensity += curveValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
absoluteIntensity = curveValue;
|
||||
hasAbsolute = true;
|
||||
}
|
||||
additiveIntensity += curveValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
absoluteIntensity = curveValue;
|
||||
hasAbsolute = true;
|
||||
}
|
||||
|
||||
if (shake.modifyCenter)
|
||||
{
|
||||
latestCenter = shake.center;
|
||||
latestCenter = shake.modifyCenter
|
||||
? shake.centerCurve.Evaluate(normalizedTime, _initialCenter)
|
||||
: shake.center;
|
||||
hasCenter = true;
|
||||
}
|
||||
|
||||
if (shake.modifyColors)
|
||||
{
|
||||
latestColorOuter = shake.colorOuter.Evaluate(normalizedTime);
|
||||
latestColorInner = shake.colorInner.Evaluate(normalizedTime);
|
||||
latestColorOuter = shake.modifyColors
|
||||
? shake.colorOuter.Evaluate(normalizedTime)
|
||||
: shake.outColor;
|
||||
latestColorInner = shake.modifyColors
|
||||
? shake.colorInner.Evaluate(normalizedTime)
|
||||
: shake.innerColor;
|
||||
hasColors = true;
|
||||
}
|
||||
|
||||
if (shake.modifyShape)
|
||||
{
|
||||
latestSmoothness = shake.smoothnessCurve.Evaluate(normalizedTime);
|
||||
latestRoundness = shake.roundnessCurve.Evaluate(normalizedTime);
|
||||
latestSmoothness = shake.modifyShape
|
||||
? shake.smoothnessCurve.Evaluate(normalizedTime)
|
||||
: shake.smoothness;
|
||||
latestRoundness = shake.modifyShape
|
||||
? shake.roundnessCurve.Evaluate(normalizedTime)
|
||||
: shake.roundness;
|
||||
hasShape = true;
|
||||
}
|
||||
|
||||
@@ -213,13 +245,18 @@ namespace Cielonos.MainGame.Effects.Feedback
|
||||
FeedbackContext feedbackContext,
|
||||
FloatCurveChannel intensityCurve,
|
||||
bool modifyCenter,
|
||||
Vector2CurveChannel centerCurve,
|
||||
Vector2 center,
|
||||
bool modifyColors,
|
||||
ColorCurveChannel colorOuter,
|
||||
ColorCurveChannel colorInner,
|
||||
Color outColor,
|
||||
Color innerColor,
|
||||
bool modifyShape,
|
||||
FloatCurveChannel smoothnessCurve,
|
||||
FloatCurveChannel roundnessCurve,
|
||||
float smoothness,
|
||||
float roundness,
|
||||
bool stop)
|
||||
{
|
||||
if (stop) { StopAll(); return; }
|
||||
@@ -227,9 +264,21 @@ namespace Cielonos.MainGame.Effects.Feedback
|
||||
if (!_resolved) return;
|
||||
|
||||
var instance = new VignetteShakeInstance(
|
||||
feedbackContext, intensityCurve, modifyCenter, center,
|
||||
modifyColors, colorOuter, colorInner, modifyShape,
|
||||
smoothnessCurve, roundnessCurve
|
||||
feedbackContext,
|
||||
intensityCurve,
|
||||
modifyCenter,
|
||||
centerCurve,
|
||||
center,
|
||||
modifyColors,
|
||||
colorOuter,
|
||||
colorInner,
|
||||
outColor,
|
||||
innerColor,
|
||||
modifyShape,
|
||||
smoothnessCurve,
|
||||
roundnessCurve,
|
||||
smoothness,
|
||||
roundness
|
||||
);
|
||||
_activeShakes.Add(instance);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user