Example #1
0
 public void Stop()
 {
     if (activeSource != null)
     {
         activeSource.Stop();
         AudioSourceManager.GetInstance().ReturnAudioSource(activeSource);
         activeSource = null;
     }
 }
Example #2
0
    public void PlayOneShot()
    {
        AudioSource source = AudioSourceManager.GetInstance().GetAudioSource();

        if (source != null)
        {
            UpdateAudioSource(source);
            source.PlayOneShot(this.clip);
            activeSource = source;
        }
    }
Example #3
0
 public void Play()
 {
     if (activeSource == null)
     {
         AudioSource source = AudioSourceManager.GetInstance().GetAudioSource();
         if (source != null)
         {
             UpdateAudioSource(source);
             source.Play();
             activeSource = source;
         }
     }
 }
Example #4
0
 public InstrumentList GetDrumsets() => (AudioSourceManager.GetInstance()).Drumset;
Example #5
0
 public IInstrument GetCurrentInstrument() => (AudioSourceManager.GetInstance()).Instruments[ProgramChange];