Files
ichni_Official/Assets/ThemeBundles/DepartureToMultiverse/Scripts/Game/Note/NoteEffect/DTMNoteHoldingBreath.cs

60 lines
1.8 KiB
C#
Raw Normal View History

2025-07-21 05:42:20 -04:00
using Ichni.RhythmGame.Beatmap;
using Lean.Pool;
using UnityEngine;
namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
{
public class DTMNoteHoldingBreath : NoteHoldingEffect
{
2026-03-14 03:13:10 -04:00
#region [] Effect Fields & States
2025-07-21 05:42:20 -04:00
private ParticleSystem breathParticle;
2026-03-14 03:13:10 -04:00
#endregion
2025-07-21 05:42:20 -04:00
2026-03-14 03:13:10 -04:00
#region [] Initialization
2025-07-21 05:42:20 -04:00
public DTMNoteHoldingBreath(DTMNoteVisualHold noteVisual)
{
this.note = noteVisual.note;
this.noteVisual = noteVisual;
this.effectTime = GetHoldingTime();
}
2026-03-14 03:13:10 -04:00
#endregion
2025-07-21 05:42:20 -04:00
2026-03-14 03:13:10 -04:00
#region [] Core Effect Implementation
2025-07-21 05:42:20 -04:00
public override void Recover()
{
if(breathParticle != null) LeanPool.Despawn(breathParticle.gameObject);
}
public override void PreExecute()
2025-08-11 14:04:06 -04:00
{
GameObject effectPrefab;
if ((note as Hold).preJudgeType == NoteBase.NoteJudgeType.Perfect)
{
effectPrefab = noteVisual.effectPrefabList[3];
}
else if ((note as Hold).preJudgeType == NoteBase.NoteJudgeType.Good)
{
effectPrefab = noteVisual.effectPrefabList[4];
}
else if ((note as Hold).preJudgeType == NoteBase.NoteJudgeType.Bad)
{
effectPrefab = noteVisual.effectPrefabList[5];
}
else
{
return;
}
breathParticle = LeanPool.Spawn(effectPrefab, noteVisual.judgeEffect.transform).GetComponent<ParticleSystem>();
2025-07-21 05:42:20 -04:00
breathParticle.Play();
}
public override void Adjust()
{
2025-08-11 14:04:06 -04:00
breathParticle?.Stop(true, ParticleSystemStopBehavior.StopEmittingAndClear);
2025-07-21 05:42:20 -04:00
}
2026-03-14 03:13:10 -04:00
#endregion
2025-07-21 05:42:20 -04:00
}
2026-03-14 03:13:10 -04:00
}