54 lines
1.7 KiB
C#
54 lines
1.7 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using DG.Tweening;
|
|
using UnityEngine;
|
|
|
|
namespace Ichni.RhythmGame.ThemeBundles.Basic
|
|
{
|
|
public class BasicNoteBadExpand : NoteEffectBase
|
|
{
|
|
Renderer noteMainRenderer;
|
|
public BasicNoteBadExpand(NoteBase note)
|
|
{
|
|
this.note = note;
|
|
this.noteVisual = note.noteVisual.GetComponent<BasicNoteVisual>();
|
|
this.noteMainRenderer = noteVisual.noteMain.GetComponent<Renderer>();
|
|
}
|
|
|
|
public override void Recover()
|
|
{
|
|
noteVisual.noteMain.SetActive(true);
|
|
noteVisual.noteMain.transform.localScale = Vector3.one;
|
|
noteMainRenderer.material.SetColor("_BaseColor", Color.white);
|
|
}
|
|
|
|
public override void Adjust()
|
|
{
|
|
noteMainRenderer.material.DOColor(Color.clear, 0.2f).SetEase(Ease.OutQuad);
|
|
noteVisual.noteMain.transform.DOScale(Vector3.one * 1.5f, 0.2f).SetEase(Ease.OutQuad).OnComplete(() => 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;
|
|
}
|
|
}
|
|
} |