67 lines
2.1 KiB
C#
67 lines
2.1 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using Ichni.RhythmGame.Beatmap;
|
|
using Lean.Pool;
|
|
using MoreMountains.Feedbacks;
|
|
using MoreMountains.FeedbacksForThirdParty;
|
|
using UnityEngine;
|
|
|
|
namespace Ichni.RhythmGame
|
|
{
|
|
public class ChromaticAberrationEffect : EffectBase
|
|
{
|
|
public float duration;
|
|
public float peak;
|
|
public AnimationCurve intensityCurve;
|
|
|
|
public ChromaticAberrationEffect(float duration, float peak, AnimationCurve intensityCurve)
|
|
{
|
|
this.effectTime = 0;
|
|
this.duration = duration;
|
|
this.peak = peak;
|
|
this.intensityCurve = intensityCurve;
|
|
}
|
|
|
|
public override void Adjust()
|
|
{
|
|
MMF_Player effect = LeanPool.Spawn(GameManager.instance.basePrefabs.chromaticAberrationEffect).GetComponent<MMF_Player>();
|
|
effect.GetFeedbackOfType<MMF_ChromaticAberration_URP>().Duration = duration;
|
|
effect.GetFeedbackOfType<MMF_ChromaticAberration_URP>().RemapIntensityOne = peak;
|
|
effect.GetFeedbackOfType<MMF_ChromaticAberration_URP>().Intensity = intensityCurve;
|
|
effect.PlayFeedbacks();
|
|
LeanPool.Despawn(effect.gameObject, duration);
|
|
}
|
|
|
|
public override EffectBase_BM ConvertToBM()
|
|
{
|
|
return new ChromaticAberrationEffect_BM(duration, peak);
|
|
}
|
|
}
|
|
|
|
namespace Beatmap
|
|
{
|
|
public class ChromaticAberrationEffect_BM : EffectBase_BM
|
|
{
|
|
public float duration;
|
|
public float peak;
|
|
public AnimationCurve intensityCurve;
|
|
|
|
public ChromaticAberrationEffect_BM()
|
|
{
|
|
|
|
}
|
|
|
|
public ChromaticAberrationEffect_BM(float duration, float peak)
|
|
{
|
|
this.effectTime = 0;
|
|
this.duration = duration;
|
|
this.peak = peak;
|
|
}
|
|
|
|
public override EffectBase ConvertToGameType(GameElement attachedGameElement)
|
|
{
|
|
return new ChromaticAberrationEffect(duration, peak, intensityCurve);
|
|
}
|
|
}
|
|
}
|
|
} |