public static GameObject CreateNotesObject(GameObject notesPrefab, NotesData notesData) { GameObject obj = Instantiate <GameObject>(notesPrefab); NotesBehaviour notes = obj.GetComponent <NotesBehaviour>(); notes.NotesData = notesData; return(obj); }
void CreateNextNotes() { float currentTime = Time.time - startTime; foreach (var channel in channels) { while (channel.Count > 0 && channel.Peek().Time + timeOffsetToCreate < currentTime) { NotesBehaviour.CreateNotesObject(notes, channel.Dequeue()); } } }