Signed-off-by: TRAfoer <lhf190@outlook.com>
This commit is contained in:
2025-09-21 13:34:59 +08:00
parent 7f7324bdb8
commit 4966ba353a
29 changed files with 1528 additions and 1981 deletions

View File

@@ -56,6 +56,17 @@ namespace Ichni.RhythmGame
SetRemove(effectSettings);
}
public override void CopyParametersFrom(EffectBase other)
{
if (other is BloomEffect o)
{
this.duration = o.duration;
this.peak = o.peak;
// 深拷贝曲线,避免引用同一个对象
this.intensityCurve = o.intensityCurve != null ? new AnimationCurve(o.intensityCurve.keys) : null;
}
}
}
namespace Beatmap

View File

@@ -25,7 +25,15 @@ namespace Ichni.RhythmGame
this.offsetValue = offsetValue;
this.offsetCurve = offsetCurve;
}
public override void CopyParametersFrom(EffectBase other)
{
if (other is CameraOffsetEffect otherEffect)
{
this.duration = otherEffect.duration;
this.offsetValue = otherEffect.offsetValue;
this.offsetCurve = otherEffect.offsetCurve != null ? new AnimationCurve(otherEffect.offsetCurve.keys) : null;
}
}
public override void Recover()
{
if (!EditorManager.instance.cameraManager.haveGameCamera)

View File

@@ -26,6 +26,17 @@ namespace Ichni.RhythmGame
this.amplitudeY = amplitudeY;
this.amplitudeZ = amplitudeZ;
}
public override void CopyParametersFrom(EffectBase other)
{
if (other is CameraShakeEffect otherEffect)
{
this.duration = otherEffect.duration;
this.frequency = otherEffect.frequency;
this.amplitudeX = otherEffect.amplitudeX;
this.amplitudeY = otherEffect.amplitudeY;
this.amplitudeZ = otherEffect.amplitudeZ;
}
}
public override void Adjust()
{

View File

@@ -26,6 +26,15 @@ namespace Ichni.RhythmGame
this.tiltValue = tiltValue;
this.tiltCurve = tiltCurve;
}
public override void CopyParametersFrom(EffectBase other)
{
if (other is CameraTiltEffect otherEffect)
{
this.duration = otherEffect.duration;
this.tiltValue = otherEffect.tiltValue;
this.tiltCurve = otherEffect.tiltCurve != null ? new AnimationCurve(otherEffect.tiltCurve.keys) : null;
}
}
public override void Recover()
{

View File

@@ -23,6 +23,15 @@ namespace Ichni.RhythmGame
this.relativeZoom = relativeZoom;
this.zoomCurve = zoomCurve;
}
public override void CopyParametersFrom(EffectBase other)
{
if (other is CameraZoomEffect otherEffect)
{
this.duration = otherEffect.duration;
this.relativeZoom = otherEffect.relativeZoom;
this.zoomCurve = otherEffect.zoomCurve != null ? new AnimationCurve(otherEffect.zoomCurve.keys) : null;
}
}
public override void Adjust()
{

View File

@@ -22,6 +22,16 @@ namespace Ichni.RhythmGame
this.peak = peak;
this.intensityCurve = intensityCurve;
}
public override void CopyParametersFrom(EffectBase other)
{
if (other is ChromaticAberrationEffect otherEffect)
{
this.duration = otherEffect.duration;
this.peak = otherEffect.peak;
this.intensityCurve = otherEffect.intensityCurve != null ? new AnimationCurve(otherEffect.intensityCurve.keys) : null;
}
}
public override void Adjust()
{

View File

@@ -27,6 +27,17 @@ namespace Ichni.RhythmGame
this.useExpression = useExpression;
this.expression = expression;
}
public override void CopyParametersFrom(EffectBase other)
{
if (other is EnableControlEffect otherEffect)
{
this.connectedGameElement = otherEffect.connectedGameElement;
this.connectedVariableName = otherEffect.connectedVariableName;
this.enableValue = otherEffect.enableValue;
this.useExpression = otherEffect.useExpression;
this.expression = otherEffect.expression;
}
}
public override void Recover()
{

View File

@@ -22,6 +22,16 @@ namespace Ichni.RhythmGame
this.peak = peak;
this.intensityCurve = intensityCurve;
}
public override void CopyParametersFrom(EffectBase other)
{
if (other is HighPassFilterEffect otherEffect)
{
this.duration = otherEffect.duration;
this.peak = otherEffect.peak;
this.intensityCurve = otherEffect.intensityCurve != null ? new AnimationCurve(otherEffect.intensityCurve.keys) : null;
}
}
public override void Adjust()
{

View File

@@ -22,6 +22,16 @@ namespace Ichni.RhythmGame
this.bottom = bottom;
this.intensityCurve = intensityCurve;
}
public override void CopyParametersFrom(EffectBase other)
{
if (other is LowPassFilterEffect otherEffect)
{
this.duration = otherEffect.duration;
this.bottom = otherEffect.bottom;
this.intensityCurve = otherEffect.intensityCurve != null ? new AnimationCurve(otherEffect.intensityCurve.keys) : null;
}
}
public override void Adjust()
{

View File

@@ -21,6 +21,16 @@ namespace Ichni.RhythmGame
this.bottomY = bottomY;
this.intensityCurve = intensityCurve;
}
public override void CopyParametersFrom(EffectBase other)
{
if (other is PixelateEffect otherEffect)
{
this.duration = otherEffect.duration;
this.bottomX = otherEffect.bottomX;
this.bottomY = otherEffect.bottomY;
this.intensityCurve = otherEffect.intensityCurve != null ? new AnimationCurve(otherEffect.intensityCurve.keys) : null;
}
}
public override void Recover()
{

View File

@@ -8,15 +8,15 @@ namespace Ichni.RhythmGame
{
public class RadialBlurEffect : EffectBase
{
private readonly NBPostProcessingController nbController;
private readonly NBPostProcessingController nbController;
public float duration;
public int sampleLevel;
public float position;
public float fadeRange;
public float peakIntensity;
public AnimationCurve intensityCurve;
public RadialBlurEffect(float duration, int sampleLevel, float position, float fadeRange, float peakIntensity, AnimationCurve intensityCurve)
{
this.effectTime = duration;
@@ -28,7 +28,19 @@ namespace Ichni.RhythmGame
this.intensityCurve = intensityCurve;
this.nbController = EditorManager.instance.postProcessingManager.nbController;
}
public override void CopyParametersFrom(EffectBase other)
{
if (other is RadialBlurEffect otherEffect)
{
this.duration = otherEffect.duration;
this.sampleLevel = otherEffect.sampleLevel;
this.position = otherEffect.position;
this.fadeRange = otherEffect.fadeRange;
this.peakIntensity = otherEffect.peakIntensity;
this.intensityCurve = otherEffect.intensityCurve != null ? new AnimationCurve(otherEffect.intensityCurve.keys) : null;
}
}
public override void Recover()
{
nbController.radialBlurToggle = false;
@@ -52,7 +64,7 @@ namespace Ichni.RhythmGame
float intensity = Mathf.Lerp(0, peakIntensity, intensityCurve.Evaluate(effectProgressPercent));
nbController.radialBlurIntensity = intensity;
}
public override void Adjust()
{
nbController.radialBlurToggle = false;
@@ -104,7 +116,7 @@ namespace Ichni.RhythmGame
this.peakIntensity = peakIntensity;
this.intensityCurve = intensityCurve;
}
public override EffectBase ConvertToGameType(GameElement attachedGameElement)
{
return new RadialBlurEffect(duration, sampleLevel, position, fadeRange, peakIntensity, intensityCurve)

View File

@@ -26,6 +26,17 @@ namespace Ichni.RhythmGame
this.color = color;
this.intensityCurve = intensityCurve;
}
public override void CopyParametersFrom(EffectBase other)
{
if (other is VignetteEffect otherEffect)
{
this.duration = otherEffect.duration;
this.peak = otherEffect.peak;
this.smoothness = otherEffect.smoothness;
this.color = otherEffect.color;
this.intensityCurve = otherEffect.intensityCurve != null ? new AnimationCurve(otherEffect.intensityCurve.keys) : null;
}
}
public override void Adjust()
{