public override void Update() { base.Update(); if (VoezEditor.Editor.trackEditMode) { notePreviewVisible = false; float posPerc = Util.InvScreenPosX(Input.mousePosition.x); if (previewX >= 0) { posPerc = previewX; } pos.x = Util.ScreenPosX(posPerc); pos.y = VoezEditor.windowRes.y * (1.0f - Track.TRACK_SCREEN_HEIGHT); // Add Track if (Util.ShiftDown() && Input.GetMouseButtonUp(0) && VoezEditor.Editor.trackEditMode && !VoezEditor.Editor.MenuOpen && VoezEditor.Editor.EditMode) { ProjectData.TrackData newTrack = new ProjectData.TrackData(); newTrack.id = VoezEditor.Editor.GetUniqueTempNoteID(); newTrack.start = VoezEditor.Editor.songTime; float timeIncrement = VoezEditor.Editor.GetBPMTimeIncrement(); newTrack.end = Mathf.Clamp(VoezEditor.Editor.songTime + timeIncrement * 10f, 0f, VoezEditor.Editor.musicPlayer.source.clip.length); newTrack.size = 1f; newTrack.x = Mathf.RoundToInt(posPerc * 100f) / 100f; VoezEditor.Editor.project.AddTrack(newTrack); VoezEditor.Editor.RefreshAllTracks(); } } }
public TrackEditor(Vector2 pos, ProjectData.TrackData data) { this.data = data; this.pos = pos; numLines = 3; valueLabel = new FLabel("Raleway16", "Value: "); startLabel = new FLabel("Raleway16", "Spawn Time: " + VoezEditor.Editor.BeatTimeStamp(data.start)); endLabel = new FLabel("Raleway16", "Despawn Time: " + VoezEditor.Editor.BeatTimeStamp(data.end)); }
public Track(ProjectData.TrackData data) { this.data = data; ID = data.id; }