50 lines
1.6 KiB
C#
50 lines
1.6 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace Ichni.RhythmGame
|
|
{
|
|
public abstract class NoteHoldingEffect : NoteEffectBase
|
|
{
|
|
#region [子类特化数据] Hold Specific Data
|
|
public float GetHoldingTime()
|
|
{
|
|
return (note as Hold).holdEndTime - note.exactJudgeTime;
|
|
}
|
|
#endregion
|
|
|
|
#region [效果逻辑覆盖] Effect Pattern Overrides
|
|
public override void UpdateEffect(float judgeTime)
|
|
{
|
|
EffectState state = CheckEffectState(judgeTime);
|
|
float songTime = CoreServices.TimeProvider.SongTime;
|
|
|
|
if (state == EffectState.Before && nowEffectState != EffectState.Before)
|
|
{
|
|
nowEffectState = EffectState.Before;
|
|
effectProgressPercent = 0;
|
|
Recover();
|
|
}
|
|
else if (state == EffectState.Middle && (note as Hold).preJudgeType != NoteBase.NoteJudgeType.NotJudged)
|
|
{
|
|
if (nowEffectState == EffectState.Before)
|
|
{
|
|
PreExecute();
|
|
}
|
|
|
|
nowEffectState = EffectState.Middle;
|
|
effectProgressPercent = (songTime - judgeTime) / effectTime;
|
|
Execute();
|
|
}
|
|
else if (state == EffectState.After && nowEffectState != EffectState.After)
|
|
{
|
|
nowEffectState = EffectState.After;
|
|
effectProgressPercent = 1;
|
|
Adjust();
|
|
}
|
|
}
|
|
#endregion
|
|
}
|
|
|
|
|
|
} |