音频特效等
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni.RhythmGame.Beatmap
|
||||
{
|
||||
@@ -23,6 +24,7 @@ namespace Ichni.RhythmGame.Beatmap
|
||||
|
||||
public override void ExecuteBM()
|
||||
{
|
||||
Debug.Log($"Executing Displacement_BM: {elementName} on {attachedElementGuid} with position ({positionX}, {positionY}, {positionZ})");
|
||||
matchedElement = Displacement.GenerateElement(elementName, elementGuid, tags, false, GetElement(attachedElementGuid),
|
||||
positionX.ConvertToGameType(), positionY.ConvertToGameType(), positionZ.ConvertToGameType());
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ namespace Ichni.RhythmGame.Beatmap
|
||||
{
|
||||
[System.Obsolete] public float duration;
|
||||
public float peak;
|
||||
public bool useEQ = false;
|
||||
public AnimationCurve intensityCurve;
|
||||
|
||||
public HighPassFilterEffect_BM()
|
||||
@@ -14,16 +15,17 @@ namespace Ichni.RhythmGame.Beatmap
|
||||
|
||||
}
|
||||
|
||||
public HighPassFilterEffect_BM(float duration, float peak, AnimationCurve intensityCurve)
|
||||
public HighPassFilterEffect_BM(float duration, float peak, bool useEQ, AnimationCurve intensityCurve)
|
||||
{
|
||||
this.effectTime = duration;
|
||||
this.peak = peak;
|
||||
this.useEQ = useEQ;
|
||||
this.intensityCurve = intensityCurve;
|
||||
}
|
||||
|
||||
public override EffectBase ConvertToGameType(GameElement attachedGameElement)
|
||||
{
|
||||
return new HighPassFilterEffect(effectTime, peak, intensityCurve)
|
||||
return new HighPassFilterEffect(effectTime, peak, useEQ, intensityCurve)
|
||||
{
|
||||
attachedGameElement = attachedGameElement
|
||||
};
|
||||
|
||||
@@ -7,6 +7,7 @@ namespace Ichni.RhythmGame.Beatmap
|
||||
{
|
||||
[System.Obsolete] public float duration;
|
||||
public float bottom;
|
||||
public bool useEQ;
|
||||
public AnimationCurve intensityCurve;
|
||||
|
||||
public LowPassFilterEffect_BM()
|
||||
@@ -14,16 +15,17 @@ namespace Ichni.RhythmGame.Beatmap
|
||||
|
||||
}
|
||||
|
||||
public LowPassFilterEffect_BM(float duration, float bottom, AnimationCurve intensityCurve)
|
||||
public LowPassFilterEffect_BM(float duration, float bottom, bool useEQ, AnimationCurve intensityCurve)
|
||||
{
|
||||
this.effectTime = duration;
|
||||
this.bottom = bottom;
|
||||
this.useEQ = useEQ;
|
||||
this.intensityCurve = intensityCurve;
|
||||
}
|
||||
|
||||
public override EffectBase ConvertToGameType(GameElement attachedGameElement)
|
||||
{
|
||||
return new LowPassFilterEffect(effectTime, bottom, intensityCurve)
|
||||
return new LowPassFilterEffect(effectTime, bottom, useEQ, intensityCurve)
|
||||
{
|
||||
attachedGameElement = attachedGameElement
|
||||
};
|
||||
|
||||
@@ -12,8 +12,9 @@ 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(effectTime));
|
||||
var effectTimeField = inspector.GenerateInputField(this, effectSettings, "EffectTime", nameof(effectTime));
|
||||
var bloomPeakField = inspector.GenerateInputField(this, effectSettings, "Bottom", nameof(peak));
|
||||
var useEQToggle = inspector.GenerateToggle(this, effectSettings, "Use EQ", nameof(useEQ));
|
||||
var intensityCurveButton = inspector.GenerateButton(this, effectSettings, "Intensity Curve", () =>
|
||||
{
|
||||
var intensityCurveWindow =
|
||||
|
||||
@@ -14,6 +14,7 @@ namespace Ichni.RhythmGame
|
||||
var effectSettings = container.GenerateSubcontainer(3);
|
||||
var effectTimeField = inspector.GenerateInputField(this, effectSettings, "Duration", nameof(effectTime));
|
||||
var bloomPeakField = inspector.GenerateInputField(this, effectSettings, "Bottom", nameof(bottom));
|
||||
var useEQToggle = inspector.GenerateToggle(this, effectSettings, "Use EQ", nameof(useEQ));
|
||||
var intensityCurveButton = inspector.GenerateButton(this, effectSettings, "Intensity Curve", () =>
|
||||
{
|
||||
var intensityCurveWindow =
|
||||
|
||||
@@ -42,8 +42,8 @@ namespace Ichni.RhythmGame
|
||||
{ "SetInteger", () => new SetIntegerEffect("New Variable", 0, false, 0, 1) },
|
||||
{ "EnableControl", () => new EnableControlEffect(null, "New Variable", 0, false, "") },
|
||||
{ "Pixelate", () => new PixelateEffect(1, 320, 180, CustomCurvePresets.Instant()) },
|
||||
{ "LowPassFilter", () => new LowPassFilterEffect(1, 10, CustomCurvePresets.Parabolic(1, 0, 1)) },
|
||||
{ "HighPassFilter", () => new HighPassFilterEffect(1, 22000, CustomCurvePresets.Parabolic(1, 0, 1)) },
|
||||
{ "LowPassFilter", () => new LowPassFilterEffect(1, 20, true, CustomCurvePresets.Parabolic(1, 0, 1)) },
|
||||
{ "HighPassFilter", () => new HighPassFilterEffect(1, 20000, true, CustomCurvePresets.Parabolic(1, 0, 1)) },
|
||||
{ "SpeedLines", () => new SpeedLinesEffect(1f, CustomCurvePresets.Parabolic(1, 0, 1), new Color(1f, 1f, 1f, 0.5f), peakRemap: 0f) },
|
||||
{ "DTM_RippleEffect", () => new DTMRippleEffect(0.65f, Color.white, 0) }
|
||||
};
|
||||
|
||||
@@ -10,14 +10,16 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
#region [运行时缓存数据] Property Caches
|
||||
public float peak;
|
||||
public bool useEQ;
|
||||
public AnimationCurve intensityCurve;
|
||||
#endregion
|
||||
|
||||
#region [生成与初始化] Generation & Initialization
|
||||
public HighPassFilterEffect(float duration, float peak, AnimationCurve intensityCurve)
|
||||
: base(duration)
|
||||
public HighPassFilterEffect(float effectTime, float peak, bool useEQ, AnimationCurve intensityCurve)
|
||||
: base(effectTime)
|
||||
{
|
||||
this.peak = peak;
|
||||
this.useEQ = useEQ;
|
||||
this.intensityCurve = intensityCurve;
|
||||
}
|
||||
|
||||
@@ -27,6 +29,7 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
this.effectTime = otherEffect.effectTime;
|
||||
this.peak = otherEffect.peak;
|
||||
this.useEQ = otherEffect.useEQ;
|
||||
this.intensityCurve = otherEffect.intensityCurve != null ? new AnimationCurve(otherEffect.intensityCurve.keys) : null;
|
||||
}
|
||||
}
|
||||
@@ -43,7 +46,7 @@ namespace Ichni.RhythmGame
|
||||
if (EditorManager.instance.musicPlayer.highPassFilter != null)
|
||||
{
|
||||
float intensity = intensityCurve != null ? intensityCurve.Evaluate(effectProgressPercent) : 0f;
|
||||
EditorManager.instance.musicPlayer.highPassFilter.cutoffFrequency = Mathf.Lerp(10f, peak, intensity);
|
||||
EditorManager.instance.musicPlayer.highPassFilter.cutoffFrequency = Mathf.Lerp(20f, peak, intensity);
|
||||
Debug.Log($"HighPassFilterEffect executing: cutoffFrequency set to {EditorManager.instance.musicPlayer.highPassFilter.cutoffFrequency}");
|
||||
}
|
||||
}
|
||||
@@ -62,7 +65,7 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
if (EditorManager.instance.musicPlayer.highPassFilter != null)
|
||||
{
|
||||
EditorManager.instance.musicPlayer.highPassFilter.cutoffFrequency = 10f;
|
||||
EditorManager.instance.musicPlayer.highPassFilter.cutoffFrequency = 20f;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,7 +75,7 @@ namespace Ichni.RhythmGame
|
||||
#region [保存与序列化] Serialize & BM
|
||||
public override EffectBase_BM ConvertToBM()
|
||||
{
|
||||
return new HighPassFilterEffect_BM(effectTime, peak, intensityCurve);
|
||||
return new HighPassFilterEffect_BM(effectTime, peak, useEQ, intensityCurve);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
@@ -10,14 +10,16 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
#region [运行时缓存数据] Property Caches
|
||||
public float bottom;
|
||||
public bool useEQ;
|
||||
public AnimationCurve intensityCurve;
|
||||
#endregion
|
||||
|
||||
#region [生成与初始化] Generation & Initialization
|
||||
public LowPassFilterEffect(float duration, float bottom, AnimationCurve intensityCurve)
|
||||
: base(duration)
|
||||
public LowPassFilterEffect(float effectTime, float bottom, bool useEQ, AnimationCurve intensityCurve)
|
||||
: base(effectTime)
|
||||
{
|
||||
this.bottom = bottom;
|
||||
this.useEQ = useEQ;
|
||||
this.intensityCurve = intensityCurve;
|
||||
}
|
||||
|
||||
@@ -27,6 +29,7 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
this.effectTime = otherEffect.effectTime;
|
||||
this.bottom = otherEffect.bottom;
|
||||
this.useEQ = otherEffect.useEQ;
|
||||
this.intensityCurve = otherEffect.intensityCurve != null ? new AnimationCurve(otherEffect.intensityCurve.keys) : null;
|
||||
}
|
||||
}
|
||||
@@ -43,7 +46,7 @@ namespace Ichni.RhythmGame
|
||||
if (EditorManager.instance.musicPlayer.lowPassFilter != null)
|
||||
{
|
||||
float intensity = intensityCurve != null ? intensityCurve.Evaluate(effectProgressPercent) : 0f;
|
||||
EditorManager.instance.musicPlayer.lowPassFilter.cutoffFrequency = Mathf.Lerp(22000f, bottom, intensity);
|
||||
EditorManager.instance.musicPlayer.lowPassFilter.cutoffFrequency = Mathf.Lerp(20000f, bottom, intensity);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +64,7 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
if (EditorManager.instance.musicPlayer.lowPassFilter != null)
|
||||
{
|
||||
EditorManager.instance.musicPlayer.lowPassFilter.cutoffFrequency = 22000f;
|
||||
EditorManager.instance.musicPlayer.lowPassFilter.cutoffFrequency = 20000f;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +74,7 @@ namespace Ichni.RhythmGame
|
||||
#region [保存与序列化] Serialize & BM
|
||||
public override EffectBase_BM ConvertToBM()
|
||||
{
|
||||
return new LowPassFilterEffect_BM(effectTime, bottom, intensityCurve);
|
||||
return new LowPassFilterEffect_BM(effectTime, bottom, useEQ, intensityCurve);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user