Files
ichni_Creator_Studio/Assets/ThemeBundles/Basic/Scripts/NoteVisual/BasicNotePerfectBurst.cs
SoulliesOfficial 5f64c4faf8 基础内容-6
技术性调整;
Note效果;
2025-01-30 22:45:33 -05:00

58 lines
1.8 KiB
C#

using System.Collections;
using System.Collections.Generic;
using DG.Tweening;
using UnityEngine;
namespace Ichni.RhythmGame.ThemeBundles.Basic
{
public class BasicNotePerfectBurst : NoteEffectBase
{
private GameObject effectRing;
public BasicNotePerfectBurst(NoteBase note)
{
this.note = note;
this.noteVisual = note.noteVisual.GetComponent<BasicNoteVisual>();
this.effectRing = noteVisual.effectPartList[0];
}
public override void Recover()
{
effectRing.SetActive(false);
effectRing.transform.localScale = Vector3.zero;
effectRing.GetComponent<SpriteRenderer>().color = Color.white;
noteVisual.noteMain.SetActive(true);
}
public override void Adjust()
{
effectRing.gameObject.SetActive(true);
effectRing.transform.DOScale(Vector3.one, 0.1f).SetEase(Ease.OutBack);
effectRing.GetComponent<SpriteRenderer>().DOFade(0, 0.1f).SetEase(Ease.OutBack).OnComplete(() => effectRing.SetActive(false));
noteVisual.noteMain.SetActive(false);
}
public override EffectState CheckEffectState()
{
float songTime = EditorManager.instance.songModule.songTime;
if (songTime < note.exactJudgeTime )
{
return EffectState.Before;
}
if (songTime >= note.exactJudgeTime &&
songTime <= note.exactJudgeTime + effectTime)
{
return EffectState.Middle;
}
if (songTime > note.exactJudgeTime + effectTime)
{
return EffectState.After;
}
return EffectState.Error;
}
}
}