public void PlayMusic(MUSIC_TYPE music) { if (m_audio_source.isPlaying) { m_audio_source.Stop(); } string path = MUSIC_PATH + music.ToString(); AudioClip clip = (AudioClip)Resources.Load(path, typeof(AudioClip)); m_audio_source.clip = clip; m_audio_source.Play(); }
//'delay' 초 후에 음악을 재생한다 public void Play(MUSIC_TYPE musicType, float delay) { musicPlayer.Stop(); musicPlayer.clip = musicClips[musicType.ToString()]; musicPlayer.PlayDelayed(delay); }
//음악을 재생한다 public void Play(MUSIC_TYPE musicType) { musicPlayer.Stop(); musicPlayer.clip = musicClips[musicType.ToString()]; musicPlayer.Play(); }