98 lines
3.2 KiB
C#
98 lines
3.2 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using Ichni.RhythmGame.Beatmap;
|
|
using UnityEngine;
|
|
|
|
namespace Ichni.RhythmGame
|
|
{
|
|
public class RadialBlurEffect : EffectBase
|
|
{
|
|
private readonly PostProcessingController 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;
|
|
this.duration = duration;
|
|
this.sampleLevel = sampleLevel;
|
|
this.position = position;
|
|
this.fadeRange = fadeRange;
|
|
this.peakIntensity = peakIntensity;
|
|
this.intensityCurve = intensityCurve;
|
|
this.nbController = GameManager.instance.postProcessingManager.nbController;
|
|
}
|
|
|
|
public override void Recover()
|
|
{
|
|
nbController.radialBlurToggle = false;
|
|
}
|
|
|
|
public override void Disrupt()
|
|
{
|
|
nbController.radialBlurToggle = false;
|
|
}
|
|
|
|
public override void PreExecute()
|
|
{
|
|
nbController.radialBlurToggle = true;
|
|
nbController.radialBlurSampleCount = sampleLevel;
|
|
nbController.radialBlurPos = position;
|
|
nbController.radialBlurRange = fadeRange;
|
|
}
|
|
|
|
public override void Execute()
|
|
{
|
|
float intensity = Mathf.Lerp(0, peakIntensity, intensityCurve.Evaluate(effectProgressPercent));
|
|
nbController.radialBlurIntensity = intensity;
|
|
}
|
|
|
|
public override void Adjust()
|
|
{
|
|
nbController.radialBlurToggle = false;
|
|
}
|
|
|
|
public override EffectBase_BM ConvertToBM()
|
|
{
|
|
return new RadialBlurEffect_BM(duration, sampleLevel, position, fadeRange, peakIntensity, intensityCurve);
|
|
}
|
|
}
|
|
|
|
|
|
namespace Beatmap
|
|
{
|
|
public class RadialBlurEffect_BM : EffectBase_BM
|
|
{
|
|
public float duration;
|
|
public int sampleLevel;
|
|
public float position;
|
|
public float fadeRange;
|
|
public float peakIntensity;
|
|
public AnimationCurve intensityCurve;
|
|
|
|
public RadialBlurEffect_BM(float duration, int sampleLevel, float position, float fadeRange, float peakIntensity, AnimationCurve intensityCurve)
|
|
{
|
|
this.effectTime = duration;
|
|
this.duration = duration;
|
|
this.sampleLevel = sampleLevel;
|
|
this.position = position;
|
|
this.fadeRange = fadeRange;
|
|
this.peakIntensity = peakIntensity;
|
|
this.intensityCurve = intensityCurve;
|
|
}
|
|
|
|
public override EffectBase ConvertToGameType(GameElement attachedGameElement)
|
|
{
|
|
return new RadialBlurEffect(duration, sampleLevel, position, fadeRange, peakIntensity, intensityCurve)
|
|
{
|
|
attachedGameElement = attachedGameElement,
|
|
};
|
|
}
|
|
}
|
|
}
|
|
} |