non-strip hold完成
This commit is contained in:
@@ -13,7 +13,9 @@ namespace Ichni.RhythmGame
|
||||
public partial class Hold : NoteBase
|
||||
{
|
||||
public float holdEndTime;
|
||||
public float holdingTime;
|
||||
public bool isHolding;
|
||||
public bool isFinalJudged;
|
||||
|
||||
public static Hold GenerateElement(string elementName, Guid id, List<string> tags, bool isFirstGenerated,
|
||||
GameElement parentElement, float exactJudgeTime, float holdEndTime)
|
||||
@@ -23,6 +25,7 @@ namespace Ichni.RhythmGame
|
||||
hold.Initialize(elementName, id, tags, isFirstGenerated, parentElement);
|
||||
hold.exactJudgeTime = exactJudgeTime;
|
||||
hold.holdEndTime = holdEndTime;
|
||||
hold.holdingTime = 0;
|
||||
|
||||
if (parentElement.TryGetComponent(out Track track))
|
||||
{
|
||||
@@ -48,6 +51,31 @@ namespace Ichni.RhythmGame
|
||||
return hold;
|
||||
}
|
||||
}
|
||||
|
||||
public partial class Hold
|
||||
{
|
||||
public override void UpdateNoteInMovableTrack()
|
||||
{
|
||||
if (!isHolding && !isFinalJudged)
|
||||
{
|
||||
base.UpdateNoteInMovableTrack();
|
||||
}
|
||||
|
||||
if (noteVisual is NoteVisualBaseHold noteVisualHold)
|
||||
{
|
||||
noteVisualHold.UpdateHoldInMovableTrack();
|
||||
}
|
||||
}
|
||||
|
||||
public override void UpdateNoteInStaticTrack()
|
||||
{
|
||||
base.UpdateNoteInStaticTrack();
|
||||
if (noteVisual is NoteVisualBaseHold noteVisualHold)
|
||||
{
|
||||
noteVisualHold.UpdateHoldInStaticTrack();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public partial class Hold
|
||||
{
|
||||
@@ -92,10 +120,7 @@ namespace Ichni.RhythmGame
|
||||
|
||||
if (isOnTrack)
|
||||
{
|
||||
if (track.trackTimeSubmodule is TrackTimeSubmoduleStatic)
|
||||
{
|
||||
UpdateNoteInStaticTrack();
|
||||
}
|
||||
UpdateNoteInTrack();
|
||||
}
|
||||
|
||||
float songTime = EditorManager.instance.songInformation.songTime;
|
||||
@@ -104,11 +129,19 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
isFirstJudged = false;
|
||||
isHolding = false;
|
||||
isFinalJudged = false;
|
||||
holdingTime = 0;
|
||||
}
|
||||
|
||||
if (isHolding)
|
||||
{
|
||||
holdingTime = songTime - exactJudgeTime;
|
||||
}
|
||||
|
||||
if (isHolding && songTime > holdEndTime)
|
||||
{
|
||||
isHolding = false;
|
||||
isFinalJudged = true;
|
||||
}
|
||||
|
||||
if (!isFirstJudged && songTime >= exactJudgeTime)
|
||||
|
||||
@@ -7,6 +7,16 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
public class NoteVisualBaseHold : NoteVisualBase
|
||||
{
|
||||
public Hold hold;
|
||||
|
||||
public virtual void UpdateHoldInMovableTrack()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public virtual void UpdateHoldInStaticTrack()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user