// Spawns a drag note. // Definition of a DRAGNOTE: [offset, noteType, numSections, startPath,endPath,length,DragNoteType] - DEPRECATED // New Drag Note - Start & End Paths now reprsent different sections on the board. public static void SpawnDrag(string[] def) { // Change the name of the note for easier debugging. noteID = "Note " + noteIndex.ToString(); noteIndex++; float offset = float.Parse(def[0]) / 1000f; int numSections = int.Parse(def[2]); int startPath = int.Parse(def[3]); int endPath = int.Parse(def[4]); float length = float.Parse(def[5]); string dragNoteTypeString = def[6]; NoteDragType dragNoteType; switch (dragNoteTypeString) { case ("L"): dragNoteType = NoteDragType.Linear; break; case ("C"): dragNoteType = NoteDragType.Curve; break; case ("R"): dragNoteType = NoteDragType.Root; break; default: dragNoteType = NoteDragType.Linear; break; } string definition = offset + "," + numSections + "," + startPath + "," + endPath + "," + length; Vector3 spawnPosition = new Vector3(NotePath.NotePaths[startPath].transform.position.x, basePosition.y, basePosition.z); NoteDrag n = (NoteDrag)GetNoteFromPool(NoteType.Drag); NoteDrag temp = Instantiate(Drag, spawnPosition, baseRotation).GetComponent <NoteDrag>(); temp.Construct(spawnPosition, offset, startPath, endPath, length, dragNoteType, noteID); }
private void PreloadNotes() { for (int i = 0; i < noteAmount; i++) { Note tempNote = Instantiate(Note, spawnPosition, BoardObject.rotation).GetComponent <Note>(); NoteList.Add(tempNote); tempNote.gameObject.SetActive(false); NoteFlick tempFlick = Instantiate(Flick, spawnPosition, BoardObject.rotation).GetComponent <NoteFlick>(); FlickList.Add(tempFlick); tempFlick.gameObject.SetActive(false); NoteHold tempHold = Instantiate(Hold, spawnPosition, BoardObject.rotation).GetComponent <NoteHold>(); HoldList.Add(tempHold); tempHold.gameObject.SetActive(false); } for (int i = 0; i < dragAmount; i++) { NoteDrag tempDrag = Instantiate(Drag, spawnPosition, BoardObject.rotation).GetComponent <NoteDrag>(); DragList.Add(tempDrag); tempDrag.gameObject.SetActive(false); } }
// Getters and Setters public void SetActiveDragNote(NoteDrag drag) { activeNoteDrag = drag; }