同步-后处理调整
This commit is contained in:
@@ -7,8 +7,8 @@ namespace Ichni.RhythmGame
|
||||
public class PixelateEffect : EffectBase
|
||||
{
|
||||
#region [效果参数] Effect Parameters
|
||||
public float bottomX;
|
||||
public float bottomY;
|
||||
[Range(0f, 1f)] public float bottomX;
|
||||
[Range(0f, 1f)] public float bottomY;
|
||||
public AnimationCurve intensityCurve;
|
||||
|
||||
private PixelateVolume _pixelateVolume;
|
||||
@@ -19,8 +19,8 @@ namespace Ichni.RhythmGame
|
||||
: base(effectTime) // 激活受控时间分段
|
||||
{
|
||||
this.effectTime = effectTime;
|
||||
this.bottomX = bottomX;
|
||||
this.bottomY = bottomY;
|
||||
this.bottomX = Mathf.Clamp01(bottomX);
|
||||
this.bottomY = Mathf.Clamp01(bottomY);
|
||||
this.intensityCurve = intensityCurve;
|
||||
}
|
||||
|
||||
@@ -41,8 +41,8 @@ namespace Ichni.RhythmGame
|
||||
if (_pixelateVolume != null)
|
||||
{
|
||||
_pixelateVolume.forceActive.value = true;
|
||||
_pixelateVolume.strengthX.value = Screen.width;
|
||||
_pixelateVolume.strengthY.value = Screen.height;
|
||||
_pixelateVolume.strengthX.value = 1f;
|
||||
_pixelateVolume.strengthY.value = 1f;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,8 +50,9 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
if (_pixelateVolume != null)
|
||||
{
|
||||
float x = Mathf.Lerp(Screen.width, bottomX, intensityCurve.Evaluate(effectProgressPercent));
|
||||
float y = Mathf.Lerp(Screen.height, bottomY, intensityCurve.Evaluate(effectProgressPercent));
|
||||
float progress = intensityCurve == null ? effectProgressPercent : intensityCurve.Evaluate(effectProgressPercent);
|
||||
float x = Mathf.Lerp(1f, Mathf.Clamp01(bottomX), progress);
|
||||
float y = Mathf.Lerp(1f, Mathf.Clamp01(bottomY), progress);
|
||||
|
||||
_pixelateVolume.strengthX.value = x;
|
||||
_pixelateVolume.strengthY.value = y;
|
||||
@@ -67,8 +68,8 @@ namespace Ichni.RhythmGame
|
||||
if (_pixelateVolume != null)
|
||||
{
|
||||
_pixelateVolume.forceActive.value = false;
|
||||
_pixelateVolume.strengthX.value = Screen.width;
|
||||
_pixelateVolume.strengthY.value = Screen.height;
|
||||
_pixelateVolume.strengthX.value = 1f;
|
||||
_pixelateVolume.strengthY.value = 1f;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user