@@ -10,19 +10,54 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
public class DTMNoteHoldingBreath : NoteHoldingEffect
|
||||
{
|
||||
private ParticleSystem breathParticle;
|
||||
|
||||
|
||||
public DTMNoteHoldingBreath(DTMNoteVisualHold noteVisual)
|
||||
{
|
||||
this.note = noteVisual.note;
|
||||
this.noteVisual = noteVisual;
|
||||
this.effectTime = GetHoldingTime();
|
||||
}
|
||||
|
||||
|
||||
public override void Recover()
|
||||
{
|
||||
if(breathParticle != null) LeanPool.Despawn(breathParticle.gameObject);
|
||||
if (breathParticle != null)
|
||||
LeanPool.Despawn(breathParticle.gameObject);
|
||||
}
|
||||
public override void UpdateEffect(float triggerTime)
|
||||
{
|
||||
EffectState state = CheckEffectState(triggerTime);
|
||||
float songTime = EditorManager.instance.songInformation.songTime;
|
||||
|
||||
if (state == EffectState.Before)
|
||||
{
|
||||
Recover();
|
||||
if (nowEffectState != EffectState.Before)
|
||||
{
|
||||
nowEffectState = EffectState.Before;
|
||||
effectProgressPercent = 0;
|
||||
}
|
||||
|
||||
}
|
||||
else if (state == EffectState.Middle)
|
||||
{
|
||||
if (nowEffectState == EffectState.Before || nowEffectState == EffectState.After)
|
||||
{
|
||||
PreExecute();
|
||||
}
|
||||
|
||||
nowEffectState = EffectState.Middle;
|
||||
effectProgressPercent = (songTime - triggerTime) / effectTime;
|
||||
Execute();
|
||||
}
|
||||
else if (state == EffectState.After && nowEffectState != EffectState.After)
|
||||
{
|
||||
if (nowEffectState != EffectState.Middle)
|
||||
PreExecute();
|
||||
nowEffectState = EffectState.After;
|
||||
effectProgressPercent = 1;
|
||||
Adjust();
|
||||
}
|
||||
}
|
||||
public override void PreExecute()
|
||||
{
|
||||
GameObject effectPrefab = null;
|
||||
@@ -40,7 +75,8 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if (breathParticle != null)
|
||||
LeanPool.Despawn(breathParticle.gameObject);
|
||||
breathParticle = LeanPool.Spawn(effectPrefab, noteVisual.judgeEffect.transform).GetComponent<ParticleSystem>();
|
||||
breathParticle.Play();
|
||||
}
|
||||
@@ -69,12 +105,12 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
|
||||
{
|
||||
public DTMNoteHoldingBreath_BM()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public DTMNoteHoldingBreath_BM(float effectTime) : base(effectTime)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
public override EffectBase ConvertToGameType(GameElement attachedGameElement)
|
||||
|
||||
Reference in New Issue
Block a user