public void SetSelectedNoteToDrag() { if (selectedNoteType != NoteType.Drag) { selectedNoteType = NoteType.Drag; return; } else { selectedNoteDragType = (NoteDragType)(((int)selectedNoteDragType + 1) % 3); switch (selectedNoteDragType) { case (NoteDragType.Curve): DragText.text = "Drag (Curve)"; break; case (NoteDragType.Linear): DragText.text = "Drag (Linear)"; break; case (NoteDragType.Root): DragText.text = "Drag (Root)"; break; } } }
public override void Construct(float offset, int notePathId, int endPath, float length, NoteDragType dragType, Vector3 spawnPosition) { this.offset = offset; this.notePathId = notePathId; this.endPath = endPath; this.length = length; this.dragType = dragType; this.startPosition = spawnPosition; if (this.dragType == NoteDragType.Curve || this.dragType == NoteDragType.Root) { numSegments = 16; } else { numSegments = 2; } lineRenderer.numPositions = numSegments; // Kinda uneeded imo segments = new List <Vector3>(numSegments); for (int i = 0; i < numSegments; i++) { segments.Add(Vector3.zero); } dragStartPoint = NotePath.NotePaths[notePathId].transform.position.x; dragEndPoint = NotePath.NotePaths[endPath].transform.position.x; totalHeight = Mathf.Pow(numSegments - 1, 2); Debug.Log("Drag Note: " + notePathId + ", " + endPath + ", " + length + ", " + lineRenderer.numPositions); CalculatePositions(); for (int i = 0; i < lineRenderer.numPositions; i++) { lineRenderer.SetPosition(i, segments[i]); // Debug.Log("Set Position " + i + ": " + segments[i]); } }
public override void Construct(Vector3 spawnPosition, float offset, int startPath, int endPath, float length, NoteDragType dragType, string NoteName) { startPosition = spawnPosition; transform.position = spawnPosition; EndTime = offset; this.notePathID = startPath; this.startPath = startPath; this.endPath = endPath; this.length = length; this.dragType = dragType; name = NoteName; // Determine number of segments needed if (dragType == NoteDragType.Linear) { lineRenderer.numPositions = 2; } else { lineRenderer.numPositions = 16; } // Load the segment points. segments = new List <Vector3>(lineRenderer.numPositions); for (int i = 0; i < lineRenderer.numPositions; i++) { segments.Add(Vector3.zero); } dragStartPos = NotePath.NotePaths[startPath].transform.position.x; dragEndPos = NotePath.NotePaths[endPath].transform.position.x; totalHeight = Mathf.Pow(lineRenderer.numPositions - 1, 2); }
} // Construct a Flick note. public virtual void Construct(Vector3 spawnPosition, float offset, int startPath, int endPath, float length, NoteDragType noteDragType, string NoteName) { } // Construct a Drag Note
private EditorNoteBase SpawnDragNote(float timestamp, int notePathId, float length, NoteDragType type, int endPath = -1) { Vector3 spawnPosition = new Vector3(NotePath.NotePaths[notePathId].transform.position.x, basePosition.y + 0.1f, basePosition.z); EditorNoteDrag note = Instantiate(EditorNoteDragPrefab, spawnPosition, BoardObject.rotation).GetComponent <EditorNoteDrag>(); note.Construct(timestamp, notePathId, endPath, length, type, spawnPosition); AddNoteToList(note); return(note); }
public virtual void Construct(float offset, int notePathId, int endPath, float length, NoteDragType dragType, Vector3 spawnPosition) { }