Files
ichni_Creator_Studio/Assets/ThemeBundles/DepartureToMultiverse/Scripts/NoteEffect/DTMNoteHoldingBreath.cs
SoulliesOfficial 87e11b6c8a 特效改
2025-08-09 05:39:32 -04:00

86 lines
2.7 KiB
C#

using System.Collections;
using System.Collections.Generic;
using Ichni.Editor;
using Ichni.RhythmGame.Beatmap;
using Lean.Pool;
using UnityEngine;
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);
}
public override void PreExecute()
{
GameObject effectPrefab = null;
switch (EditorManager.instance.currentJudgeType)
{
case NoteBase.NoteJudgeType.Perfect:
effectPrefab = noteVisual.effectPrefabList[3];
break;
case NoteBase.NoteJudgeType.Good:
effectPrefab = noteVisual.effectPrefabList[4];
break;
case NoteBase.NoteJudgeType.Bad:
effectPrefab = noteVisual.effectPrefabList[5];
break;
default:
return;
}
breathParticle = LeanPool.Spawn(effectPrefab, noteVisual.judgeEffect.transform).GetComponent<ParticleSystem>();
breathParticle.Play();
}
public override void Adjust()
{
breathParticle?.Stop(true, ParticleSystemStopBehavior.StopEmittingAndClear);
}
public override EffectBase_BM ConvertToBM()
{
return new Beatmap.DTMNoteHoldingBreath_BM(effectTime);
}
public override void SetUpInspector()
{
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;
var container = inspector.GenerateContainer("Basic Note Holding Expand");
var subcontainer = container.GenerateSubcontainer(3);
}
}
namespace Beatmap
{
public class DTMNoteHoldingBreath_BM : NoteHoldingEffect_BM
{
public DTMNoteHoldingBreath_BM()
{
}
public DTMNoteHoldingBreath_BM(float effectTime) : base(effectTime)
{
}
public override EffectBase ConvertToGameType(GameElement attachedGameElement)
{
return new DTMNoteHoldingBreath(attachedGameElement as DTMNoteVisualHold);
}
}
}
}