66 lines
2.0 KiB
C#
66 lines
2.0 KiB
C#
using Ichni.RhythmGame.Beatmap;
|
|
using Lean.Pool;
|
|
using MoreMountains.Feedbacks;
|
|
using MoreMountains.FeedbacksForThirdParty;
|
|
using UnityEngine;
|
|
|
|
namespace Ichni.RhythmGame
|
|
{
|
|
public class BloomEffect : EffectBase
|
|
{
|
|
public float duration;
|
|
public float peak;
|
|
public AnimationCurve intensityCurve;
|
|
|
|
public BloomEffect(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.bloomEffect).GetComponent<MMF_Player>();
|
|
effect.GetFeedbackOfType<MMF_Bloom_URP>().ShakeDuration = duration;
|
|
effect.GetFeedbackOfType<MMF_Bloom_URP>().RemapIntensityOne = peak;
|
|
effect.GetFeedbackOfType<MMF_Bloom_URP>().ShakeIntensity = intensityCurve;
|
|
effect.PlayFeedbacks();
|
|
LeanPool.Despawn(effect.gameObject, duration);
|
|
}
|
|
|
|
public override EffectBase_BM ConvertToBM()
|
|
{
|
|
return new BloomEffect_BM(duration, peak, intensityCurve);
|
|
}
|
|
}
|
|
|
|
namespace Beatmap
|
|
{
|
|
public class BloomEffect_BM : EffectBase_BM
|
|
{
|
|
public float duration;
|
|
public float peak;
|
|
public AnimationCurve intensityCurve;
|
|
|
|
public BloomEffect_BM()
|
|
{
|
|
|
|
}
|
|
|
|
public BloomEffect_BM(float duration, float peak, AnimationCurve intensityCurve)
|
|
{
|
|
this.effectTime = 0;
|
|
this.duration = duration;
|
|
this.peak = peak;
|
|
this.intensityCurve = intensityCurve;
|
|
}
|
|
|
|
public override EffectBase ConvertToGameType(GameElement attachedGameElement)
|
|
{
|
|
return new BloomEffect(duration, peak, intensityCurve);
|
|
}
|
|
}
|
|
}
|
|
} |