@@ -35,6 +35,8 @@ namespace Ichni.Editor
|
||||
|
||||
private string BeatText;
|
||||
private string TimeText;
|
||||
|
||||
|
||||
protected override void Start()
|
||||
{
|
||||
TimeField.onSelect.AddListener(_ => EditorManager.instance.musicPlayer.PauseMusic());
|
||||
@@ -42,7 +44,8 @@ namespace Ichni.Editor
|
||||
ProgressSlider.onValueChanged.AddListener(_ =>
|
||||
{
|
||||
EditorManager.instance.musicPlayer.PauseMusic();
|
||||
EditorManager.instance.songInformation.songTime = (ProgressSlider.value * EditorManager.instance.songInformation.songLength) - EditorManager.instance.songInformation.offset;
|
||||
SetTime((ProgressSlider.value * EditorManager.instance.songInformation.songLength + EditorManager.instance.songInformation.offset).ToString());
|
||||
//EditorManager.instance.songInformation.songTime = (ProgressSlider.value * EditorManager.instance.songInformation.songLength) - EditorManager.instance.songInformation.offset;
|
||||
UpdateTime();
|
||||
});
|
||||
|
||||
|
||||
@@ -281,7 +281,28 @@ namespace Ichni.RhythmGame
|
||||
holdingHoldList.Remove(this);
|
||||
}
|
||||
}
|
||||
public void SetFinishEffects()//一定在播放完之后再搞这个
|
||||
{
|
||||
noteVisual.effectSubmodule.effectCollection["Holding"].ForEach(e => e.Adjust());
|
||||
|
||||
|
||||
// noteVisual.effectSubmodule.effectCollection["GeneralJudge"].ForEach(e => e.Adjust());
|
||||
// switch (EditorManager.instance.currentJudgeType)
|
||||
// {
|
||||
// case NoteJudgeType.Perfect:
|
||||
// noteVisual.effectSubmodule.effectCollection["Perfect"].ForEach(e => e.Adjust());
|
||||
// break;
|
||||
// case NoteJudgeType.Good:
|
||||
// noteVisual.effectSubmodule.effectCollection["Good"].ForEach(e => e.Adjust());
|
||||
// break;
|
||||
// case NoteJudgeType.Bad:
|
||||
// noteVisual.effectSubmodule.effectCollection["Bad"].ForEach(e => e.Adjust());
|
||||
// break;
|
||||
// case NoteJudgeType.Miss:
|
||||
// noteVisual.effectSubmodule.effectCollection["Miss"].ForEach(e => e.Adjust());
|
||||
// break;
|
||||
// }
|
||||
}
|
||||
private void LateUpdate()
|
||||
{
|
||||
if (isOnTrack)
|
||||
|
||||
@@ -72,12 +72,12 @@ namespace Ichni.RhythmGame
|
||||
if (exactJudgeTime - beyondTime - 0.5f > -EditorManager.instance.songInformation.delay)
|
||||
{
|
||||
gameObject.SetActive(false);
|
||||
if (this is Hold hold)
|
||||
{
|
||||
EditorManager.instance.noteManager.RegisterNote(hold, hold.exactJudgeTime - beyondTime - 0.5f, hold.holdEndTime + finishTime + 1.5f);
|
||||
// if (this is Hold hold)
|
||||
// {
|
||||
// EditorManager.instance.noteManager.RegisterNote(hold, hold.exactJudgeTime - beyondTime - 0.1f, + finishTime + 0.5f);
|
||||
|
||||
}
|
||||
else EditorManager.instance.noteManager.RegisterNote(this, exactJudgeTime - beyondTime - 0.5f, exactJudgeTime + finishTime + 1.5f);
|
||||
// }
|
||||
EditorManager.instance.noteManager.RegisterNote(this, exactJudgeTime - beyondTime - 0.1f, (this is Hold hold ? hold.holdEndTime : exactJudgeTime) + finishTime + 0.1f);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
public List<(NoteBase note, float activationTime, float finishTime)> pendingNotes = new List<(NoteBase, float, float)>();
|
||||
private int nextNoteIndex = 0;
|
||||
|
||||
private List<(NoteBase note1, bool isActive, float activationTime)> ProcessingNotes = new List<(NoteBase, bool, float)>();
|
||||
public void RegisterNote(NoteBase note, float activationTime, float finishTime)
|
||||
{
|
||||
pendingNotes.Add((note, activationTime, finishTime));
|
||||
@@ -25,9 +25,29 @@ namespace Ichni.RhythmGame
|
||||
|
||||
void Update()
|
||||
{
|
||||
|
||||
float currentTime = EditorManager.instance.songInformation.songTime;
|
||||
|
||||
foreach (var item in ProcessingNotes)
|
||||
{
|
||||
var (note, isActive, activationTime) = item;
|
||||
if (!isActive) note.Update();
|
||||
note.gameObject.SetActive(isActive);
|
||||
if (isActive)
|
||||
{
|
||||
note.Update();
|
||||
if (currentTime < activationTime)
|
||||
{
|
||||
note.noteVisual?.Recover();
|
||||
|
||||
}
|
||||
else if (note is Hold hold && currentTime >= hold.holdEndTime)
|
||||
{
|
||||
hold.SetFinishEffects();
|
||||
}
|
||||
}
|
||||
}
|
||||
ProcessingNotes.Clear();
|
||||
|
||||
// 一次性移除所有 null 项
|
||||
pendingNotes.RemoveAll(item => item.note == null);
|
||||
|
||||
@@ -39,13 +59,12 @@ namespace Ichni.RhythmGame
|
||||
|
||||
if (shouldBeActive && !isActive)
|
||||
{
|
||||
note.gameObject.SetActive(true);
|
||||
if (currentTime < note.exactJudgeTime) note.noteVisual?.Recover();
|
||||
ProcessingNotes.Add((note, true, activationTime));
|
||||
|
||||
}
|
||||
else if (!shouldBeActive && isActive)
|
||||
{
|
||||
|
||||
note.gameObject.SetActive(false);
|
||||
ProcessingNotes.Add((note, false, activationTime));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user