This commit is contained in:
SoulliesOfficial
2026-03-26 14:48:04 -04:00
parent 731726239a
commit 11423add8f
100 changed files with 196597 additions and 1049 deletions

View File

@@ -30,8 +30,6 @@ namespace Ichni.Editor.Commands
{
if (target == null) return;
ReflectionHelper.SetDeepValue(target, path, newValue);
// 修复:必须主动唤醒目标通知其数据已完成覆写,否则拖拽属性将无法立刻映射到真实世界物体
target.Refresh();
}
public void Undo()
@@ -42,8 +40,7 @@ namespace Ichni.Editor.Commands
ReflectionHelper.SetDeepValue(target, path, oldValue);
target.Refresh();
// 通知 UI 面板重载(保证数据被回滚后,界面的参数显示不再是之前打错的值)
RefreshInspectorIfMatched();
}
public void Redo()
@@ -53,7 +50,7 @@ namespace Ichni.Editor.Commands
ReflectionHelper.SetDeepValue(target, path, newValue);
target.Refresh();
RefreshInspectorIfMatched();
}
public bool TryMerge(ICommand other)

View File

@@ -12,11 +12,6 @@ namespace Ichni.Editor
{
public Button button;
public TMP_Text buttonText;
public override void Initialize(IBaseElement baseElement, string title, string parameterName)
{
base.Initialize(baseElement, title, parameterName);
}
public void SetText(string buttonText)
{
this.buttonText.text = buttonText;
@@ -44,6 +39,13 @@ namespace Ichni.Editor
customAction?.Invoke();
}
public override void Initialize(IBaseElement baseElement, string title, string parameterName)
{
// 精确地仅重置 Button 的可交互状态(为了解决从对象池取回被禁用的废弃按钮问题)
if (button != null) button.interactable = true;
base.Initialize(baseElement, title, parameterName);
}
public override DynamicUIElement AddListenerFunction(UnityAction action)
{
customAction += action;

View File

@@ -36,6 +36,7 @@ namespace Ichni.Editor
{
dropdownComponent.CreateNewItem(name);
}
dropdownComponent.selectedItemIndex = 0;
dropdownComponent.SetupDropdown();
}

View File

@@ -56,7 +56,8 @@ namespace Ichni.Editor
dropdownComponent.CreateNewItem(item);
}
// 统一刷新 UI
// 统一刷新 UI前,重置 selectedItemIndex 为 0防止前一次使用的残余索引越界
dropdownComponent.selectedItemIndex = 0;
dropdownComponent.SetupDropdown();
}

View File

@@ -5,7 +5,7 @@ namespace Ichni.RhythmGame.Beatmap
{
public class BloomEffect_BM : EffectBase_BM
{
public float duration;
[System.Obsolete] public float duration;
public float peak;
public AnimationCurve intensityCurve;
@@ -16,15 +16,14 @@ namespace Ichni.RhythmGame.Beatmap
public BloomEffect_BM(float duration, float peak, AnimationCurve intensityCurve)
{
this.effectTime = 0;
this.duration = duration;
this.effectTime = duration;
this.peak = peak;
this.intensityCurve = intensityCurve;
}
public override EffectBase ConvertToGameType(GameElement attachedGameElement)
{
return new BloomEffect(duration, peak, intensityCurve)
return new BloomEffect(effectTime, peak, intensityCurve)
{
attachedGameElement = attachedGameElement
};

View File

@@ -5,7 +5,7 @@ namespace Ichni.RhythmGame.Beatmap
{
public class CameraOffsetEffect_BM : EffectBase_BM
{
public float duration;
[System.Obsolete] public float duration;
public Vector3 offsetValue;
public AnimationCurve offsetCurve;
@@ -17,14 +17,13 @@ namespace Ichni.RhythmGame.Beatmap
public CameraOffsetEffect_BM(float duration, Vector3 offsetValue, AnimationCurve offsetCurve)
{
this.effectTime = duration;
this.duration = duration;
this.offsetValue = offsetValue;
this.offsetCurve = offsetCurve;
}
public override EffectBase ConvertToGameType(GameElement attachedGameElement)
{
return new CameraOffsetEffect(duration, offsetValue, offsetCurve)
return new CameraOffsetEffect(effectTime, offsetValue, offsetCurve)
{
attachedGameElement = attachedGameElement
};

View File

@@ -5,7 +5,7 @@ namespace Ichni.RhythmGame.Beatmap
{
public class CameraShakeEffect_BM : EffectBase_BM
{
public float duration;
[System.Obsolete] public float duration;
public float frequency;
public float amplitudeX;
public float amplitudeY;
@@ -18,8 +18,7 @@ namespace Ichni.RhythmGame.Beatmap
public CameraShakeEffect_BM(float duration, float frequency, float amplitudeX, float amplitudeY, float amplitudeZ)
{
this.effectTime = 0;
this.duration = duration;
this.effectTime = duration;
this.frequency = frequency;
this.amplitudeX = amplitudeX;
this.amplitudeY = amplitudeY;
@@ -28,7 +27,7 @@ namespace Ichni.RhythmGame.Beatmap
public override EffectBase ConvertToGameType(GameElement attachedGameElement)
{
return new CameraShakeEffect(duration, frequency, amplitudeX, amplitudeY, amplitudeZ)
return new CameraShakeEffect(effectTime, frequency, amplitudeX, amplitudeY, amplitudeZ)
{
attachedGameElement = attachedGameElement
};

View File

@@ -5,14 +5,13 @@ namespace Ichni.RhythmGame.Beatmap
{
public class CameraTiltEffect_BM : EffectBase_BM
{
public float duration;
[System.Obsolete] public float duration;
public Vector3 tiltValue;
public AnimationCurve tiltCurve;
public CameraTiltEffect_BM(float duration, Vector3 tiltValue, AnimationCurve tiltCurve)
{
this.effectTime = duration;
this.duration = duration;
this.tiltValue = tiltValue;
this.tiltCurve = tiltCurve;
}
@@ -24,7 +23,7 @@ namespace Ichni.RhythmGame.Beatmap
public override EffectBase ConvertToGameType(GameElement attachedGameElement)
{
return new CameraTiltEffect(duration, tiltValue, tiltCurve)
return new CameraTiltEffect(effectTime, tiltValue, tiltCurve)
{
attachedGameElement = attachedGameElement
};

View File

@@ -5,7 +5,7 @@ namespace Ichni.RhythmGame.Beatmap
{
public class CameraZoomEffect_BM : EffectBase_BM
{
public float duration;
[System.Obsolete] public float duration;
public float relativeZoom;
public AnimationCurve zoomCurve;
@@ -16,14 +16,14 @@ namespace Ichni.RhythmGame.Beatmap
public CameraZoomEffect_BM(float duration, float relativeZoom, AnimationCurve zoomCurve)
{
this.duration = duration;
this.effectTime = duration;
this.relativeZoom = relativeZoom;
this.zoomCurve = zoomCurve;
}
public override EffectBase ConvertToGameType(GameElement attachedGameElement)
{
return new CameraZoomEffect(duration, relativeZoom, zoomCurve)
return new CameraZoomEffect(effectTime, relativeZoom, zoomCurve)
{
attachedGameElement = attachedGameElement
};

View File

@@ -5,7 +5,7 @@ namespace Ichni.RhythmGame.Beatmap
{
public class ChromaticAberrationEffect_BM : EffectBase_BM
{
public float duration;
[System.Obsolete] public float duration;
public float peak;
public AnimationCurve intensityCurve;
@@ -16,15 +16,14 @@ namespace Ichni.RhythmGame.Beatmap
public ChromaticAberrationEffect_BM(float duration, float peak, AnimationCurve intensityCurve)
{
this.effectTime = 0;
this.duration = duration;
this.effectTime = duration;
this.peak = peak;
this.intensityCurve = intensityCurve;
}
public override EffectBase ConvertToGameType(GameElement attachedGameElement)
{
return new ChromaticAberrationEffect(duration, peak, intensityCurve)
return new ChromaticAberrationEffect(effectTime, peak, intensityCurve)
{
attachedGameElement = attachedGameElement
};

View File

@@ -5,7 +5,7 @@ namespace Ichni.RhythmGame.Beatmap
{
public class HighPassFilterEffect_BM : EffectBase_BM
{
public float duration;
[System.Obsolete] public float duration;
public float peak;
public AnimationCurve intensityCurve;
@@ -16,15 +16,14 @@ namespace Ichni.RhythmGame.Beatmap
public HighPassFilterEffect_BM(float duration, float peak, AnimationCurve intensityCurve)
{
this.effectTime = 0;
this.duration = duration;
this.effectTime = duration;
this.peak = peak;
this.intensityCurve = intensityCurve;
}
public override EffectBase ConvertToGameType(GameElement attachedGameElement)
{
return new HighPassFilterEffect(duration, peak, intensityCurve)
return new HighPassFilterEffect(effectTime, peak, intensityCurve)
{
attachedGameElement = attachedGameElement
};

View File

@@ -5,7 +5,7 @@ namespace Ichni.RhythmGame.Beatmap
{
public class LowPassFilterEffect_BM : EffectBase_BM
{
public float duration;
[System.Obsolete] public float duration;
public float bottom;
public AnimationCurve intensityCurve;
@@ -16,15 +16,14 @@ namespace Ichni.RhythmGame.Beatmap
public LowPassFilterEffect_BM(float duration, float bottom, AnimationCurve intensityCurve)
{
this.effectTime = 0;
this.duration = duration;
this.effectTime = duration;
this.bottom = bottom;
this.intensityCurve = intensityCurve;
}
public override EffectBase ConvertToGameType(GameElement attachedGameElement)
{
return new LowPassFilterEffect(duration, bottom, intensityCurve)
return new LowPassFilterEffect(effectTime, bottom, intensityCurve)
{
attachedGameElement = attachedGameElement
};

View File

@@ -5,7 +5,7 @@ namespace Ichni.RhythmGame.Beatmap
{
public class PixelateEffect_BM : EffectBase_BM
{
public float duration;
[System.Obsolete] public float duration;
public float bottomX;
public float bottomY;
public AnimationCurve intensityCurve;
@@ -26,7 +26,7 @@ namespace Ichni.RhythmGame.Beatmap
public override EffectBase ConvertToGameType(GameElement attachedGameElement)
{
return new PixelateEffect(duration, bottomX, bottomY, intensityCurve)
return new PixelateEffect(effectTime, bottomX, bottomY, intensityCurve)
{
attachedGameElement = attachedGameElement
};

View File

@@ -5,32 +5,39 @@ namespace Ichni.RhythmGame.Beatmap
{
public class RadialBlurEffect_BM : EffectBase_BM
{
// [兼容旧存档] 旧版字段,不再使用,但保留以允许 EasySave3 读取旧 JSON 时不产生错误
[System.Obsolete] public int sampleLevel;
[System.Obsolete] public float position;
[System.Obsolete] public float fadeRange;
// [当前版本字段]
public float duration;
public int sampleLevel;
public float position;
public float fadeRange;
public float peakIntensity;
public AnimationCurve intensityCurve;
// 新版中心坐标参数,旧存档读取时默认 0.5
public float radialCenterX = 0.5f;
public float radialCenterY = 0.5f;
public RadialBlurEffect_BM()
{
}
public RadialBlurEffect_BM(float duration, int sampleLevel, float position, float fadeRange, float peakIntensity, AnimationCurve intensityCurve)
// 新版构造函数(不含旧字段)
public RadialBlurEffect_BM(float duration, float peakIntensity, AnimationCurve intensityCurve,
float radialCenterX = 0.5f, float radialCenterY = 0.5f)
{
this.effectTime = duration;
this.duration = duration;
this.sampleLevel = sampleLevel;
this.position = position;
this.fadeRange = fadeRange;
this.peakIntensity = peakIntensity;
this.intensityCurve = intensityCurve;
this.radialCenterX = radialCenterX;
this.radialCenterY = radialCenterY;
}
public override EffectBase ConvertToGameType(GameElement attachedGameElement)
{
return new RadialBlurEffect(duration, sampleLevel, position, fadeRange, peakIntensity, intensityCurve)
return new RadialBlurEffect(duration, peakIntensity, intensityCurve, radialCenterX, radialCenterY)
{
attachedGameElement = attachedGameElement,
};

View File

@@ -5,7 +5,7 @@ namespace Ichni.RhythmGame.Beatmap
{
public class VignetteEffect_BM : EffectBase_BM
{
public float duration;
[System.Obsolete] public float duration;
public float peak;
public float smoothness;
public Color color;
@@ -18,8 +18,7 @@ namespace Ichni.RhythmGame.Beatmap
public VignetteEffect_BM(float duration, float peak, float smoothness, Color color, AnimationCurve intensityCurve)
{
this.effectTime = 0;
this.duration = duration;
this.effectTime = duration;
this.peak = peak;
this.smoothness = smoothness;
this.color = color;
@@ -28,7 +27,7 @@ namespace Ichni.RhythmGame.Beatmap
public override EffectBase ConvertToGameType(GameElement attachedGameElement)
{
return new VignetteEffect(duration, peak, smoothness, color, intensityCurve)
return new VignetteEffect(effectTime, peak, smoothness, color, intensityCurve)
{
attachedGameElement = attachedGameElement
};

View File

@@ -12,7 +12,7 @@ namespace Ichni.RhythmGame
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
var container = inspector.GenerateContainer("Bloom Shake");
var effectSettings = container.GenerateSubcontainer(3);
var effectTimeField = inspector.GenerateInputField(this, effectSettings, "Bloom Time", nameof(duration));
var effectTimeField = inspector.GenerateInputField(this, effectSettings, "Bloom Time", nameof(effectTime));
var bloomPeakField = inspector.GenerateInputField(this, effectSettings, "Bloom Peak", nameof(peak));
var intensityCurveButton = inspector.GenerateButton(this, effectSettings, "Intensity Curve", () =>
{

View File

@@ -12,7 +12,7 @@ namespace Ichni.RhythmGame
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
var container = inspector.GenerateContainer("Camera Tilt");
var subcontainer1 = container.GenerateSubcontainer(3);
var durationField = inspector.GenerateInputField(this, subcontainer1, "Duration", nameof(duration));
var durationField = inspector.GenerateInputField(this, subcontainer1, "Duration", nameof(effectTime));
var curveButton = inspector.GenerateButton(this, subcontainer1, "Offset Curve", () =>
{
var intensityCurveWindow =

View File

@@ -12,7 +12,7 @@ namespace Ichni.RhythmGame
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
var container = inspector.GenerateContainer("Camera Shake");
var effectSettings = container.GenerateSubcontainer(3);
var durationInputField = inspector.GenerateInputField(this, effectSettings, "Duration", nameof(duration));
var durationInputField = inspector.GenerateInputField(this, effectSettings, "Duration", nameof(effectTime));
var frequencyInputField = inspector.GenerateInputField(this, effectSettings, "Frequency", nameof(frequency));
var amplitudeXInputField = inspector.GenerateInputField(this, effectSettings, "Amplitude X", nameof(amplitudeX));
var amplitudeYInputField = inspector.GenerateInputField(this, effectSettings, "Amplitude Y", nameof(amplitudeY));

View File

@@ -13,7 +13,7 @@ namespace Ichni.RhythmGame
var container = inspector.GenerateContainer("Camera Tilt");
var subcontainer1 = container.GenerateSubcontainer(3);
var durationField = inspector.GenerateInputField(this, subcontainer1, "Duration", nameof(duration));
var durationField = inspector.GenerateInputField(this, subcontainer1, "Duration", nameof(effectTime));
var tiltCurveButton = inspector.GenerateButton(this, subcontainer1, "Tilt Curve", () =>
{
var intensityCurveWindow =

View File

@@ -12,7 +12,7 @@ namespace Ichni.RhythmGame
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
var container = inspector.GenerateContainer("Camera Zoom");
var effectSettings = container.GenerateSubcontainer(3);
var zoomDurationInputField = inspector.GenerateInputField(this, effectSettings, "Zoom Duration", nameof(duration));
var zoomDurationInputField = inspector.GenerateInputField(this, effectSettings, "Zoom Duration", nameof(effectTime));
var relativeZoomInputField = inspector.GenerateInputField(this, effectSettings, "Relative Zoom", nameof(relativeZoom));
var zoomCurveButton = inspector.GenerateButton(this, effectSettings, "Intensity Curve", () =>
{

View File

@@ -12,7 +12,7 @@ namespace Ichni.RhythmGame
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
var container = inspector.GenerateContainer("Chromatic Aberration");
var effectSettings = container.GenerateSubcontainer(3);
var effectTimeField = inspector.GenerateInputField(this, effectSettings, "Duration", nameof(duration));
var effectTimeField = inspector.GenerateInputField(this, effectSettings, "Duration", nameof(effectTime));
var bloomPeakField = inspector.GenerateInputField(this, effectSettings, "Peak Value", nameof(peak));
var intensityCurveButton = inspector.GenerateButton(this, effectSettings, "Intensity Curve", () =>
{

View File

@@ -12,7 +12,7 @@ namespace Ichni.RhythmGame
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
var container = inspector.GenerateContainer("High Pass Filter");
var effectSettings = container.GenerateSubcontainer(3);
var effectTimeField = inspector.GenerateInputField(this, effectSettings, "Duration", nameof(duration));
var effectTimeField = inspector.GenerateInputField(this, effectSettings, "Duration", nameof(effectTime));
var bloomPeakField = inspector.GenerateInputField(this, effectSettings, "Bottom", nameof(peak));
var intensityCurveButton = inspector.GenerateButton(this, effectSettings, "Intensity Curve", () =>
{

View File

@@ -12,7 +12,7 @@ namespace Ichni.RhythmGame
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
var container = inspector.GenerateContainer("Low Pass Filter");
var effectSettings = container.GenerateSubcontainer(3);
var effectTimeField = inspector.GenerateInputField(this, effectSettings, "Duration", nameof(duration));
var effectTimeField = inspector.GenerateInputField(this, effectSettings, "Duration", nameof(effectTime));
var bloomPeakField = inspector.GenerateInputField(this, effectSettings, "Bottom", nameof(bottom));
var intensityCurveButton = inspector.GenerateButton(this, effectSettings, "Intensity Curve", () =>
{

View File

@@ -12,7 +12,7 @@ namespace Ichni.RhythmGame
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
var container = inspector.GenerateContainer("Pixelate Effect");
var effectSettings = container.GenerateSubcontainer(3);
var effectTimeField = inspector.GenerateInputField(this, effectSettings, "Effect Time", nameof(duration));
var effectTimeField = inspector.GenerateInputField(this, effectSettings, "Effect Time", nameof(effectTime));
var bottomXField = inspector.GenerateInputField(this, effectSettings, "Bottom X", nameof(bottomX));
var bottomYField = inspector.GenerateInputField(this, effectSettings, "Bottom Y", nameof(bottomY));
var intensityCurveButton = inspector.GenerateButton(this, effectSettings, "Intensity Curve", () =>

View File

@@ -12,15 +12,13 @@ namespace Ichni.RhythmGame
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
var container = inspector.GenerateContainer("Radial Blur Effect");
var effectSettings = container.GenerateSubcontainer(3);
var effectTimeField = inspector.GenerateInputField(this, effectSettings, "Effect Time", nameof(duration));
var sampleLevelField = inspector.GenerateInputField(this, effectSettings, "Sample Level", nameof(sampleLevel));
var positionField = inspector.GenerateInputField(this, effectSettings, "Position", nameof(position));
var fadeRangeField = inspector.GenerateInputField(this, effectSettings, "Fade Range", nameof(fadeRange));
var peakIntensityField = inspector.GenerateInputField(this, effectSettings, "Peak Intensity", nameof(peakIntensity));
var intensityCurveButton = inspector.GenerateButton(this, effectSettings, "Intensity Curve", () =>
inspector.GenerateInputField(this, effectSettings, "Effect Time", nameof(duration));
inspector.GenerateInputField(this, effectSettings, "Peak Intensity", nameof(peakIntensity));
inspector.GenerateInputField(this, effectSettings, "Radial Center X", nameof(radialCenterX));
inspector.GenerateInputField(this, effectSettings, "Radial Center Y", nameof(radialCenterY));
inspector.GenerateButton(this, effectSettings, "Intensity Curve", () =>
{
var intensityCurveWindow =
inspector.GenerateCompositeParameterWindow(this, "Intensity Curve", nameof(intensityCurve)).SetAsCustomCurve();
inspector.GenerateCompositeParameterWindow(this, "Intensity Curve", nameof(intensityCurve)).SetAsCustomCurve();
});
SetRemove(effectSettings);
}

View File

@@ -12,7 +12,7 @@ namespace Ichni.RhythmGame
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
var container = inspector.GenerateContainer("Vignette");
var effectSettings = container.GenerateSubcontainer(3);
var durationField = inspector.GenerateInputField(this, effectSettings, "Duration", nameof(duration));
var durationField = inspector.GenerateInputField(this, effectSettings, "Duration", nameof(effectTime));
var peakField = inspector.GenerateInputField(this, effectSettings, "Peak Value", nameof(peak));
var smoothnessField = inspector.GenerateInputField(this, effectSettings, "Smoothness", nameof(smoothness));
var intensityCurveButton = inspector.GenerateButton(this, effectSettings, "Intensity Curve", () =>

View File

@@ -37,7 +37,7 @@ namespace Ichni.RhythmGame
{ "CameraZoom", () => new CameraZoomEffect(0.2f, 5f, CustomCurvePresets.Parabolic(1, 0, 1)) },
{ "CameraTilt", () => new CameraTiltEffect(0.2f, new Vector3(0, 0, 5), CustomCurvePresets.CustomPeakTimeParabolic(1, 0, 1, 0.3f)) },
{ "ChromaticAberration", () => new ChromaticAberrationEffect(1, 1, CustomCurvePresets.Parabolic(1, 0, 1)) },
{ "RadialBlur", () => new RadialBlurEffect(1, 4, 0.5f, 0.5f, 1, CustomCurvePresets.Parabolic(1, 0, 1)) },
{ "RadialBlur", () => new RadialBlurEffect(1, 0.5f, CustomCurvePresets.Parabolic(1, 0, 1), 0.5f, 0.5f) },
{ "Vignette", () => new VignetteEffect(1, 1, 0.4f, Color.black, CustomCurvePresets.Parabolic(1, 0, 1)) },
{ "SetInteger", () => new SetIntegerEffect("New Variable", 0, false, 0, 1) },
{ "EnableControl", () => new EnableControlEffect(null, "New Variable", 0, false, "") },

View File

@@ -7,7 +7,6 @@ namespace Ichni.RhythmGame
public partial class BloomEffect : EffectBase
{
#region [] Property Caches
public float duration;
public float peak;
public AnimationCurve intensityCurve;
@@ -16,9 +15,8 @@ namespace Ichni.RhythmGame
#region [] Generation & Initialization
public BloomEffect(float duration, float peak, AnimationCurve intensityCurve)
: base(duration) // 激活时间线
: base(duration)
{
this.duration = duration;
this.peak = peak;
this.intensityCurve = intensityCurve;
}
@@ -27,7 +25,7 @@ namespace Ichni.RhythmGame
{
if (other is BloomEffect o)
{
this.duration = o.duration;
this.effectTime = o.effectTime;
this.peak = o.peak;
this.intensityCurve = o.intensityCurve != null ? new AnimationCurve(o.intensityCurve.keys) : null;
}
@@ -70,7 +68,7 @@ namespace Ichni.RhythmGame
#region [] Serialize & BM
public override EffectBase_BM ConvertToBM()
{
return new BloomEffect_BM(duration, peak, intensityCurve);
return new BloomEffect_BM(effectTime, peak, intensityCurve);
}
#endregion
}

View File

@@ -11,7 +11,6 @@ namespace Ichni.RhythmGame
public partial class CameraOffsetEffect : EffectBase
{
#region [] Property Caches
public float duration;
public Vector3 offsetValue;
public AnimationCurve offsetCurve;
@@ -21,9 +20,8 @@ namespace Ichni.RhythmGame
#region [] Generation & Initialization
public CameraOffsetEffect(float duration, Vector3 offsetValue, AnimationCurve offsetCurve)
: base(duration)
{
this.effectTime = this.duration;
this.duration = duration;
this.offsetValue = offsetValue;
this.offsetCurve = offsetCurve;
}
@@ -32,7 +30,7 @@ namespace Ichni.RhythmGame
{
if (other is CameraOffsetEffect otherEffect)
{
this.duration = otherEffect.duration;
this.effectTime = otherEffect.effectTime;
this.offsetValue = otherEffect.offsetValue;
this.offsetCurve = otherEffect.offsetCurve != null ? new AnimationCurve(otherEffect.offsetCurve.keys) : null;
}
@@ -60,14 +58,14 @@ namespace Ichni.RhythmGame
}
//GameCamera的摄像机本体能且只能被TiltEffect和OffsetEffect修改Transform并且必须归位
offsetTweener = gameCameraTransform.DOBlendableLocalMoveBy(offsetValue, duration).SetEase(offsetCurve);
offsetTweener = gameCameraTransform.DOBlendableLocalMoveBy(offsetValue, effectTime).SetEase(offsetCurve);
}
#endregion
#region [] Serialize & BM
public override EffectBase_BM ConvertToBM()
{
return new CameraOffsetEffect_BM(duration, offsetValue, offsetCurve);
return new CameraOffsetEffect_BM(effectTime, offsetValue, offsetCurve);
}
#endregion
}

View File

@@ -9,7 +9,6 @@ namespace Ichni.RhythmGame
public partial class CameraShakeEffect : EffectBase
{
#region [] Property Caches
public float duration;
public float frequency;
public float amplitudeX;
public float amplitudeY;
@@ -20,9 +19,8 @@ namespace Ichni.RhythmGame
#region [] Generation & Initialization
public CameraShakeEffect(float duration, float frequency, float amplitudeX, float amplitudeY, float amplitudeZ)
: base(duration)
{
this.effectTime = 0;
this.duration = duration;
this.frequency = frequency;
this.amplitudeX = amplitudeX;
this.amplitudeY = amplitudeY;
@@ -33,7 +31,7 @@ namespace Ichni.RhythmGame
{
if (other is CameraShakeEffect otherEffect)
{
this.duration = otherEffect.duration;
this.effectTime = otherEffect.effectTime;
this.frequency = otherEffect.frequency;
this.amplitudeX = otherEffect.amplitudeX;
this.amplitudeY = otherEffect.amplitudeY;
@@ -82,7 +80,7 @@ namespace Ichni.RhythmGame
#region [] Serialize & BM
public override EffectBase_BM ConvertToBM()
{
return new CameraShakeEffect_BM(duration, frequency, amplitudeX, amplitudeY, amplitudeZ);
return new CameraShakeEffect_BM(effectTime, frequency, amplitudeX, amplitudeY, amplitudeZ);
}
#endregion
}

View File

@@ -11,7 +11,6 @@ namespace Ichni.RhythmGame
public partial class CameraTiltEffect : EffectBase
{
#region [] Property Caches
public float duration;
public Vector3 tiltValue;
public AnimationCurve tiltCurve;
Transform gameCameraTransform => EditorManager.instance.cameraManager.gameCamera.cam.transform;
@@ -21,9 +20,8 @@ namespace Ichni.RhythmGame
#region [] Generation & Initialization
public CameraTiltEffect(float duration, Vector3 tiltValue, AnimationCurve tiltCurve)
: base(duration)
{
this.effectTime = duration;
this.duration = duration;
this.tiltValue = tiltValue;
this.tiltCurve = tiltCurve;
}
@@ -32,7 +30,7 @@ namespace Ichni.RhythmGame
{
if (other is CameraTiltEffect otherEffect)
{
this.duration = otherEffect.duration;
this.effectTime = otherEffect.effectTime;
this.tiltValue = otherEffect.tiltValue;
this.tiltCurve = otherEffect.tiltCurve != null ? new AnimationCurve(otherEffect.tiltCurve.keys) : null;
}
@@ -61,7 +59,7 @@ namespace Ichni.RhythmGame
}
//GameCamera的摄像机本体能且只能被TiltEffect和OffsetEffect修改Transform并且必须归位
tiltTweener = gameCameraTransform.DOBlendableLocalRotateBy(tiltValue, duration, RotateMode.FastBeyond360).SetEase(tiltCurve);
tiltTweener = gameCameraTransform.DOBlendableLocalRotateBy(tiltValue, effectTime, RotateMode.FastBeyond360).SetEase(tiltCurve);
}
public override void Adjust()
@@ -73,7 +71,7 @@ namespace Ichni.RhythmGame
#region [] Serialize & BM
public override EffectBase_BM ConvertToBM()
{
return new CameraTiltEffect_BM(duration, tiltValue, tiltCurve);
return new CameraTiltEffect_BM(effectTime, tiltValue, tiltCurve);
}
public override void Disrupt()

View File

@@ -9,7 +9,6 @@ namespace Ichni.RhythmGame
public partial class CameraZoomEffect : EffectBase
{
#region [] Property Caches
public float duration;
public float relativeZoom;
public AnimationCurve zoomCurve;
@@ -19,9 +18,8 @@ namespace Ichni.RhythmGame
#region [] Generation & Initialization
public CameraZoomEffect(float duration, float relativeZoom, AnimationCurve zoomCurve)
: base(duration)
{
this.effectTime = 0f;
this.duration = duration;
this.relativeZoom = relativeZoom;
this.zoomCurve = zoomCurve;
}
@@ -30,7 +28,7 @@ namespace Ichni.RhythmGame
{
if (other is CameraZoomEffect otherEffect)
{
this.duration = otherEffect.duration;
this.effectTime = otherEffect.effectTime;
this.relativeZoom = otherEffect.relativeZoom;
this.zoomCurve = otherEffect.zoomCurve != null ? new AnimationCurve(otherEffect.zoomCurve.keys) : null;
}
@@ -70,7 +68,7 @@ namespace Ichni.RhythmGame
#region [] Serialize & BM
public override EffectBase_BM ConvertToBM()
{
return new Beatmap.CameraZoomEffect_BM(duration, relativeZoom, zoomCurve);
return new Beatmap.CameraZoomEffect_BM(effectTime, relativeZoom, zoomCurve);
}
#endregion
}

View File

@@ -7,7 +7,6 @@ namespace Ichni.RhythmGame
public partial class ChromaticAberrationEffect : EffectBase
{
#region [] Property Caches
public float duration;
public float peak;
public AnimationCurve intensityCurve;
@@ -17,9 +16,8 @@ namespace Ichni.RhythmGame
#region [] Generation & Initialization
public ChromaticAberrationEffect(float duration, float peak, AnimationCurve intensityCurve)
: base(duration) // 调用基类含时构造,将 effectTime 赋为 duration
: base(duration)
{
this.duration = duration;
this.peak = peak;
this.intensityCurve = intensityCurve;
}
@@ -28,7 +26,7 @@ namespace Ichni.RhythmGame
{
if (other is ChromaticAberrationEffect otherEffect)
{
this.duration = otherEffect.duration;
this.effectTime = otherEffect.effectTime;
this.peak = otherEffect.peak;
this.intensityCurve = otherEffect.intensityCurve != null ? new AnimationCurve(otherEffect.intensityCurve.keys) : null;
}
@@ -71,7 +69,7 @@ namespace Ichni.RhythmGame
#region [] Serialize & BM
public override EffectBase_BM ConvertToBM()
{
return new ChromaticAberrationEffect_BM(duration, peak, intensityCurve);
return new ChromaticAberrationEffect_BM(effectTime, peak, intensityCurve);
}
#endregion
}

View File

@@ -9,16 +9,14 @@ namespace Ichni.RhythmGame
public partial class HighPassFilterEffect : EffectBase
{
#region [] Property Caches
public float duration;
public float peak;
public AnimationCurve intensityCurve;
#endregion
#region [] Generation & Initialization
public HighPassFilterEffect(float duration, float peak, AnimationCurve intensityCurve)
: base(duration)
{
this.effectTime = 0;
this.duration = duration;
this.peak = peak;
this.intensityCurve = intensityCurve;
}
@@ -27,7 +25,7 @@ namespace Ichni.RhythmGame
{
if (other is HighPassFilterEffect otherEffect)
{
this.duration = otherEffect.duration;
this.effectTime = otherEffect.effectTime;
this.peak = otherEffect.peak;
this.intensityCurve = otherEffect.intensityCurve != null ? new AnimationCurve(otherEffect.intensityCurve.keys) : null;
}
@@ -46,6 +44,7 @@ namespace Ichni.RhythmGame
{
float intensity = intensityCurve != null ? intensityCurve.Evaluate(effectProgressPercent) : 0f;
EditorManager.instance.musicPlayer.highPassFilter.cutoffFrequency = Mathf.Lerp(10f, peak, intensity);
Debug.Log($"HighPassFilterEffect executing: cutoffFrequency set to {EditorManager.instance.musicPlayer.highPassFilter.cutoffFrequency}");
}
}
@@ -73,7 +72,7 @@ namespace Ichni.RhythmGame
#region [] Serialize & BM
public override EffectBase_BM ConvertToBM()
{
return new HighPassFilterEffect_BM(duration, peak, intensityCurve);
return new HighPassFilterEffect_BM(effectTime, peak, intensityCurve);
}
#endregion
}

View File

@@ -9,16 +9,14 @@ namespace Ichni.RhythmGame
public partial class LowPassFilterEffect : EffectBase
{
#region [] Property Caches
public float duration;
public float bottom;
public AnimationCurve intensityCurve;
#endregion
#region [] Generation & Initialization
public LowPassFilterEffect(float duration, float bottom, AnimationCurve intensityCurve)
: base(duration)
{
this.effectTime = 0;
this.duration = duration;
this.bottom = bottom;
this.intensityCurve = intensityCurve;
}
@@ -27,7 +25,7 @@ namespace Ichni.RhythmGame
{
if (other is LowPassFilterEffect otherEffect)
{
this.duration = otherEffect.duration;
this.effectTime = otherEffect.effectTime;
this.bottom = otherEffect.bottom;
this.intensityCurve = otherEffect.intensityCurve != null ? new AnimationCurve(otherEffect.intensityCurve.keys) : null;
}
@@ -73,7 +71,7 @@ namespace Ichni.RhythmGame
#region [] Serialize & BM
public override EffectBase_BM ConvertToBM()
{
return new LowPassFilterEffect_BM(duration, bottom, intensityCurve);
return new LowPassFilterEffect_BM(effectTime, bottom, intensityCurve);
}
#endregion
}

View File

@@ -7,7 +7,6 @@ namespace Ichni.RhythmGame
public partial class PixelateEffect : EffectBase
{
#region [] Property Caches
public float duration;
public float bottomX;
public float bottomY;
public AnimationCurve intensityCurve;
@@ -17,9 +16,8 @@ namespace Ichni.RhythmGame
#region [] Generation & Initialization
public PixelateEffect(float duration, float bottomX, float bottomY, AnimationCurve intensityCurve)
: base(duration) // 激活受控时间分段
: base(duration)
{
this.duration = duration;
this.bottomX = bottomX;
this.bottomY = bottomY;
this.intensityCurve = intensityCurve;
@@ -29,7 +27,7 @@ namespace Ichni.RhythmGame
{
if (other is PixelateEffect otherEffect)
{
this.duration = otherEffect.duration;
this.effectTime = otherEffect.effectTime;
this.bottomX = otherEffect.bottomX;
this.bottomY = otherEffect.bottomY;
this.intensityCurve = otherEffect.intensityCurve != null ? new AnimationCurve(otherEffect.intensityCurve.keys) : null;
@@ -86,7 +84,7 @@ namespace Ichni.RhythmGame
#region [] Serialize & BM
public override EffectBase_BM ConvertToBM()
{
return new PixelateEffect_BM(duration, bottomX, bottomY, intensityCurve);
return new PixelateEffect_BM(effectTime, bottomX, bottomY, intensityCurve);
}
#endregion
}

View File

@@ -8,25 +8,24 @@ namespace Ichni.RhythmGame
{
#region [] Property Caches
public float duration;
public int sampleLevel;
public float position;
public float fadeRange;
public float peakIntensity;
public AnimationCurve intensityCurve;
public float radialCenterX;
public float radialCenterY;
private RadialBlur _radialBlurVolume;
#endregion
#region [] Generation & Initialization
public RadialBlurEffect(float duration, int sampleLevel, float position, float fadeRange, float peakIntensity, AnimationCurve intensityCurve)
: base(duration) // 对接 EffectBase 含时控制
public RadialBlurEffect(float duration, float peakIntensity, AnimationCurve intensityCurve,
float radialCenterX = 0.5f, float radialCenterY = 0.5f)
: base(duration)
{
this.duration = duration;
this.sampleLevel = sampleLevel;
this.position = position;
this.fadeRange = fadeRange;
this.peakIntensity = peakIntensity;
this.intensityCurve = intensityCurve;
this.radialCenterX = radialCenterX;
this.radialCenterY = radialCenterY;
}
public override void CopyParametersFrom(EffectBase other)
@@ -34,11 +33,10 @@ namespace Ichni.RhythmGame
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;
this.radialCenterX = otherEffect.radialCenterX;
this.radialCenterY = otherEffect.radialCenterY;
}
}
@@ -57,9 +55,8 @@ namespace Ichni.RhythmGame
PrepareHandle();
if (_radialBlurVolume != null)
{
_radialBlurVolume.qualityLevel.value = RadialBlurQuality.RadialBlur_8Tap_Balance;
_radialBlurVolume.radialCenterX.value = 0.5f;
_radialBlurVolume.radialCenterY.value = 0.5f;
_radialBlurVolume.radialCenterX.value = radialCenterX;
_radialBlurVolume.radialCenterY.value = radialCenterY;
}
}
@@ -86,7 +83,7 @@ namespace Ichni.RhythmGame
#region [] Serialize & BM
public override EffectBase_BM ConvertToBM()
{
return new RadialBlurEffect_BM(duration, sampleLevel, position, fadeRange, peakIntensity, intensityCurve);
return new RadialBlurEffect_BM(duration, peakIntensity, intensityCurve, radialCenterX, radialCenterY);
}
#endregion
}

View File

@@ -7,7 +7,6 @@ namespace Ichni.RhythmGame
public partial class VignetteEffect : EffectBase
{
#region [] Property Caches
public float duration;
public float peak;
public float smoothness;
public Color color;
@@ -20,7 +19,6 @@ namespace Ichni.RhythmGame
public VignetteEffect(float duration, float peak, float smoothness, Color color, AnimationCurve intensityCurve)
: base(duration)
{
this.duration = duration;
this.peak = peak;
this.smoothness = smoothness;
this.color = color;
@@ -31,7 +29,7 @@ namespace Ichni.RhythmGame
{
if (other is VignetteEffect otherEffect)
{
this.duration = otherEffect.duration;
this.effectTime = otherEffect.effectTime;
this.peak = otherEffect.peak;
this.smoothness = otherEffect.smoothness;
this.color = otherEffect.color;
@@ -74,7 +72,6 @@ namespace Ichni.RhythmGame
private void ResetEffect()
{
// 可修改为符合游戏默认画风的暗角值,如 0.2f
if (_vignette != null) _vignette.intensity.value = 0f;
}
#endregion
@@ -82,7 +79,7 @@ namespace Ichni.RhythmGame
#region [] Serialize & BM
public override EffectBase_BM ConvertToBM()
{
return new VignetteEffect_BM(duration, peak, smoothness, color, intensityCurve);
return new VignetteEffect_BM(effectTime, peak, smoothness, color, intensityCurve);
}
#endregion
}

View File

@@ -13,46 +13,9 @@ namespace Ichni
{
public class PostProcessingManager : Singleton<PostProcessingManager>
{
public static Volume GlobalVolume => instance._globalVolume;
public static Volume GlobalVolume => instance.globalVolume;
[ShowInInspector]
private Volume _globalVolume;
protected override void Awake()
{
base.Awake();
//FindAndCacheFeatureWithReflection();
}
private void OnDisable()
{
//FindAndCacheFeatureWithReflection();
}
private void FindAndCacheFeatureWithReflection()
{
var pipelineAsset = GraphicsSettings.currentRenderPipeline as UniversalRenderPipelineAsset;
if (pipelineAsset == null)
{
Debug.LogError("当前渲染管线不是 UniversalRenderPipelineAsset。");
return;
}
// 2. 使用反射来获取内部的 m_RendererDataList 字段
FieldInfo rendererDataListField =
typeof(UniversalRenderPipelineAsset).GetField("m_RendererDataList", BindingFlags.NonPublic | BindingFlags.Instance);
if (rendererDataListField == null)
{
Debug.LogError("在 UniversalRenderPipelineAsset 中无法通过反射找到 'm_RendererDataList' 字段。API可能已在你的URP版本中更改。");
return;
}
var rendererDataList = rendererDataListField.GetValue(pipelineAsset) as ScriptableRendererData[];
if (rendererDataList == null)
{
Debug.LogError("获取渲染器数据列表失败。");
return;
}
}
[ShowInInspector, SerializeField]
private Volume globalVolume;
}
}