コード例 #1
0
    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();
    }
コード例 #2
0
 //'delay' 초 후에 음악을 재생한다
 public void Play(MUSIC_TYPE musicType, float delay)
 {
     musicPlayer.Stop();
     musicPlayer.clip = musicClips[musicType.ToString()];
     musicPlayer.PlayDelayed(delay);
 }
コード例 #3
0
 //음악을 재생한다
 public void Play(MUSIC_TYPE musicType)
 {
     musicPlayer.Stop();
     musicPlayer.clip = musicClips[musicType.ToString()];
     musicPlayer.Play();
 }