예제 #1
0
파일: AudioPlay.cs 프로젝트: pli41/LoveBar
    public IEnumerator PlayForTime(SourceWithTime soundWT)
    {
        soundWT.source.loop = true;
        soundWT.source.Play();
        yield return(new WaitForSeconds(soundWT.time));

        soundWT.source.Stop();
        soundWT.source.loop = false;
    }
예제 #2
0
파일: AudioPlay.cs 프로젝트: pli41/LoveBar
 public void PlayLoopedSoundForTime(AudioSource _source, AudioClip _sound, float time)
 {
     if (_source != null && _sound != null)
     {
         _source.Stop();
         _source.clip = _sound;
         SourceWithTime soundWT = new SourceWithTime(_source, time);
         StartCoroutine("PlayForTime", soundWT);
     }
 }