Hi guys,
I’m having some difficulty trying to make an audio scrubber using ngui, I have managed to do it using unity gui but I need to get it implemented using ngui. Heres my gui code:
void OnGUI()
{
GUI.color = Color.black;
if(AudioControllers.musicPlaying == true AudioControllers.pauseMusic == false)
{
scrollPos = GUI.HorizontalSlider(new Rect(Screen.width / 4, Screen.height - 100f, Screen.width / 2, 50f), scrollPos, 0, mainMusic.clip.length);
if(GUI.changed == true)
{
moved = true;
}
if(GUI.changed == false !Input.GetMouseButton(0) moved == false)
{
scrollPos = mainMusic.time;
}
if(Input.GetMouseButtonUp(0) moved == true)
{
mainMusic.time = scrollPos;
moved = false;
}
}
GUI.Label(new Rect(0f, 0f, 100f, 50f), (mainMusic.time).ToString());
Any help would be appreciated. I’ve managed to get the bar moving along with the audio using ngui and thats about it.