using System.Collections; using System.Collections.Generic; using Ichni.RhythmGame.Beatmap; using MoreMountains.Feedbacks; using MoreMountains.FeedbacksForThirdParty; using UnityEngine; using UnityEngine.Rendering.Universal; namespace Ichni.RhythmGame { public class VignetteEffect : EffectBase { public float duration; public float peak; public float smoothness; public Color color; public AnimationCurve intensityCurve; public VignetteEffect(float duration, float peak, float smoothness, Color color, AnimationCurve intensityCurve) { this.effectTime = 0; this.duration = duration; this.peak = peak; this.smoothness = smoothness; this.color = color; this.intensityCurve = intensityCurve; } public override void Adjust() { MMF_Player effect = Lean.Pool.LeanPool.Spawn(GameManager.instance.basePrefabs.vignetteEffect).GetComponent(); effect.GetFeedbackOfType().Duration = duration; effect.GetFeedbackOfType().RemapIntensityOne = peak; effect.GetFeedbackOfType().Intensity = intensityCurve; if (GameManager.instance.postProcessingManager.globalVolume.profile.TryGet(out Vignette vignette)) { vignette.smoothness.value = smoothness; vignette.color.value = color; } effect.PlayFeedbacks(); Lean.Pool.LeanPool.Despawn(effect.gameObject, duration); } public override EffectBase_BM ConvertToBM() { return new VignetteEffect_BM(duration, peak, smoothness, color, intensityCurve); } } namespace Beatmap { public class VignetteEffect_BM : EffectBase_BM { public float duration; public float peak; public float smoothness; public Color color; public AnimationCurve intensityCurve; public VignetteEffect_BM() { } public VignetteEffect_BM(float duration, float peak, float smoothness, Color color, AnimationCurve intensityCurve) { this.effectTime = 0; this.duration = duration; this.peak = peak; this.smoothness = smoothness; this.color = color; this.intensityCurve = intensityCurve; } public override EffectBase ConvertToGameType(GameElement attachedGameElement) { return new VignetteEffect(duration, peak, smoothness, color, intensityCurve); } } } }