@@ -1,5 +1,6 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UniRx;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -7,6 +8,7 @@ namespace Ichni.RhythmGame
|
||||
{
|
||||
public class NoteManager : MonoBehaviour
|
||||
{
|
||||
public static NoteManager instance;
|
||||
public List<(NoteBase note, float activationTime, float finishTime)> pendingNotes = new List<(NoteBase, float, float)>();
|
||||
private List<(NoteBase note1, bool isActive, float activationTime)> ProcessingNotes = new List<(NoteBase, bool, float)>();
|
||||
public void RegisterNote(NoteBase note, float activationTime, float finishTime)
|
||||
@@ -15,7 +17,22 @@ namespace Ichni.RhythmGame
|
||||
AllNotesRegistered();
|
||||
print($"Registered note {note.elementName} with activation time {activationTime} and finish time {finishTime}");
|
||||
}
|
||||
|
||||
public void Awake()
|
||||
{
|
||||
instance = this;
|
||||
}
|
||||
public void ChangeNoteInfo(NoteBase note, float activationTime, float finishTime)
|
||||
{
|
||||
int idx = pendingNotes.FindIndex(i => i.note == note);
|
||||
if (idx != -1)
|
||||
{
|
||||
var one = pendingNotes[idx];
|
||||
one.finishTime = finishTime;
|
||||
one.activationTime = activationTime;
|
||||
pendingNotes[idx] = one;
|
||||
AllNotesRegistered();
|
||||
}
|
||||
}
|
||||
// 在所有物体注册完毕后,对列表进行一次排序
|
||||
public void AllNotesRegistered()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user