@@ -108,8 +108,15 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
EffectBase newEffect = factory.Invoke(); // 创建新实例
|
||||
newEffect.attachedGameElement = attachedGameElement;
|
||||
effectCollection[effect.Key].Add(newEffect);
|
||||
newEffect.AccommodatingList = effectCollection[effect.Key];
|
||||
var list = effectCollection[effect.Key];
|
||||
// 自动继承上一个Effect的参数
|
||||
if (list.Count > 0)
|
||||
{
|
||||
var last = list[list.Count - 1];
|
||||
newEffect.CopyParametersFrom(last);
|
||||
}
|
||||
list.Add(newEffect);
|
||||
newEffect.AccommodatingList = list;
|
||||
inspectorMain.SetInspector(attachedGameElement);
|
||||
}
|
||||
else
|
||||
@@ -373,6 +380,10 @@ namespace Ichni.RhythmGame
|
||||
});
|
||||
}
|
||||
|
||||
public virtual void CopyParametersFrom(EffectBase other)
|
||||
{
|
||||
// 默认实现什么都不做,子类重写
|
||||
}
|
||||
}
|
||||
|
||||
namespace Beatmap
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
@@ -92,8 +92,9 @@ namespace Ichni.RhythmGame
|
||||
float endTime = index >= blendTimeList.Count ? finalTime : blendTimeList[index];
|
||||
if (songTime >= startTime && songTime < endTime && currentSkyboxIndex != index)
|
||||
{
|
||||
bool isSmaller = index < currentSkyboxIndex;
|
||||
currentSkyboxIndex = index;
|
||||
if (currentSkyboxIndex != 0) skyboxBlender.blendSpeed = blendSpeedList[currentSkyboxIndex - 1];
|
||||
if (currentSkyboxIndex != 0) skyboxBlender.blendSpeed = isSmaller ? 9999f : blendSpeedList[currentSkyboxIndex - 1];
|
||||
skyboxBlender.Blend(currentSkyboxIndex, false);
|
||||
DynamicGI.UpdateEnvironment();
|
||||
}
|
||||
|
||||
@@ -124,11 +124,8 @@ namespace Ichni.RhythmGame
|
||||
holdingTimeInputField.AddListenerFunction(() =>
|
||||
{
|
||||
holdEndTime = float.Parse(holdingTimeInputField.inputField.text) + exactJudgeTime;
|
||||
noteVisual?.effectSubmodule.effectCollection["Holding"].ForEach(effect =>
|
||||
{
|
||||
effect.effectTime = holdingTime;
|
||||
});
|
||||
holdEndTimeInputField.inputField.text = holdEndTime.ToString();
|
||||
holdEndTimeInputField.inputField.onEndEdit.Invoke(holdEndTimeInputField.inputField.text);
|
||||
});
|
||||
inspector.MarkedElements["ExactJudgeTime"].AddListenerFunction(() =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user