// Update is called once per frame void Update() { if (AutoNext) { m_Button.GetComponent <Image>().sprite = selected; //0.02s left for this song if (MusicPlayer.GetSongLength() - MusicPlayer.GetAudioPosSec() < 0.02f) { int index = MusicWheelBase.GetCurSongIndex() + 1; if (index >= MusicWheelBase.GetWheelItemCount()) { index = 0; } MusicWheelItem item = GameObject.Find("WheelItem" + string.Format("{0}", index)).GetComponent <MusicWheelItem>(); MusicWheelBase.SetWheelPosIndex(index); item.ButtonClicked(); GameObject.Find("SongProgressBar").GetComponent <SongProgressbar>().SetProgress(0f); GameObject.Find("PlayButton").GetComponent <PlayButton>().ButtonOnClickEvent(); } } else { m_Button.GetComponent <Image>().sprite = normal; } }
public void ButtonOnClickEvent() { int index = MusicWheelBase.GetCurSongIndex() + 1; if (index >= MusicWheelBase.GetWheelItemCount()) { index = 0; } MusicWheelItem item = GameObject.Find("WheelItem" + string.Format("{0}", index)).GetComponent <MusicWheelItem>(); MusicWheelBase.SetWheelPosIndex(index); item.ButtonClicked(); GameObject.Find("SongProgressBar").GetComponent <SongProgressbar>().SetProgress(0f); GameObject.Find("PlayButton").GetComponent <PlayButton>().ButtonOnClickEvent(); }
public void ButtonOnClickEvent() { int index = MusicWheelBase.GetCurSongIndex(); MusicWheelBase.SetWheelPosIndex(index); }