Hi guys,
I'm just after a bit of help with making a music scroll bar with ngui I have a 16 minute audio track and I am using a scroll bar to try and move it to the right point in the audio. I have it working in that it moves along with the audio however every time I move the scroll bar it always restarts the track from the beginning.
Heres the stuff I have so far:
public UIScrollBar scrollBar;
public AudioSource mainMusic;
public float newMusicTime;
void Update()
{
if(AudioControllers.musicPlaying == true && AudioControllers.pauseMusic == false)
{
scrollBar.value += 1 / mainMusic.clip.length * Time.deltaTime;
if(Input.GetMouseButtonUp(0))
{
mainMusic.time = scrollBar.value;
}
}
}
I feel that I am close but its just not working any help would be much appreciated.
Thanks.