大幅优化

Signed-off-by: TRAfoer <lhf190@outlook.com>
This commit is contained in:
2025-10-05 11:45:32 +08:00
parent e145d65d38
commit 725009e354
66 changed files with 616229 additions and 175087 deletions

View File

@@ -13,7 +13,7 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
private DTMNoteVisualHold noteVisualHold;
public float targetStartPercent, targetEndPercent;
public float startPercent, endPercent;
public DTMNoteGenerateExtend(NoteVisualBase noteVisual, float generateTime, float effectTime)
{
this.note = noteVisual.note;
@@ -31,10 +31,46 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
noteVisualHold.headPoint.SetPercent(startPercent);
noteVisualHold.tailPoint.SetPercent(endPercent);
}
public override void UpdateEffect(float triggerTime)
{
EffectState state = CheckEffectState(triggerTime);
float songTime = EditorManager.instance.songInformation.songTime;
triggerTime -= generateTime;
if (state == EffectState.Before)
{
if (nowEffectState != EffectState.Before)
{
nowEffectState = EffectState.Before;
effectProgressPercent = 0;
}
Recover();
}
else if (state == EffectState.Middle)
{
if (nowEffectState == EffectState.Before)
{
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 Recover()
{
noteVisualHold.noteMain.SetActive(false);
if (noteVisualHold.noteMain.activeSelf)
noteVisualHold.noteMain.SetActive(false);
}
public override EffectBase_BM ConvertToBM()
@@ -50,8 +86,9 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
startPercent = targetStartPercent;
endPercent = targetStartPercent;
noteVisual.noteMain.SetActive(true);
UpdateHold();
}
public override void Execute()
{
float e = AnimationCurveEvaluator.Evaluate(AnimationCurveType.OutQuad, effectProgressPercent);
@@ -66,7 +103,7 @@ namespace Ichni.RhythmGame.ThemeBundles.DepartureToMultiverse
endPercent = targetEndPercent;
UpdateHold();
}
public override void SetUpInspector()
{
IHaveInspection inspector = EditorManager.instance.uiManager.inspector;

View File

@@ -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)