public virtual void PrepareAction() { if (!AudioManager.getIsPlaying(musicToPlay.ToString())) { AudioManager.StopAllMusic(); AudioManager.PlayMusic(musicToPlay.ToString(), Vector3.zero); } }
public void PlayTheMusic() { if (restartTheMusic || !AudioManager.getIsPlaying(musicToPlay.ToString())) { AudioManager.StopAllMusic(); AudioManager.PlayMusic(musicToPlay.ToString(), transform.position); } }
void Update() { if (!AudioManager.getIsPlaying(nowPlaying.ToString())) { PlayTheMusic(); } }
public void Load(MusicNames MusicName, Levels level) { NotesManager notesManager = (NotesManager)FindObjectOfType(typeof(NotesManager)); MoveManager moveManager = (MoveManager)FindObjectOfType(typeof(MoveManager)); JudgeScript judgeScript = (JudgeScript)FindObjectOfType(typeof(JudgeScript)); string folderName = "Data/" + MusicName.ToString() + "/"; TextAsset musicData = Resources.Load <TextAsset>(folderName + tuneData); StringReader sr = new StringReader(musicData.text); while (sr.Peek() != -1) { string _str = sr.ReadLine(); string[] str = _str.Split(','); TuneDataIndex tuneDataIndex; Enum.TryParse <TuneDataIndex>(str[0], out tuneDataIndex); switch (tuneDataIndex) { case TuneDataIndex.NAME: musicName = str[1]; break; case TuneDataIndex.BPM: bpm = float.Parse(str[1]); break; case TuneDataIndex.OFFSET: offset = float.Parse(str[1]); break; } } notesManager.SetBPM(bpm); notesManager.SetOffset(offset); TextAsset notesData = Resources.Load <TextAsset>(folderName + level.ToString() + "NotesData"); notesManager.Load(notesData); AudioClip clip = Resources.Load <AudioClip>(folderName + clipName); moveManager.Init(); moveManager.SetClip(clip); judgeScript.Init(); moveManager.MusicStart(); }
public void PlayTheMusic() { AudioManager.StopAllMusic(); nowPlaying = musicToPlay[Random.Range(0, musicToPlay.Length)]; AudioManager.PlayMusic(nowPlaying.ToString(), transform.position); }
public void PlayTheMusic() { AudioManager.StopAllMusic(); AudioManager.PlayMusic(musicToPlay.ToString(), transform.position); }