Exemplo n.º 1
0
 public void PlayAndWait(float volume)
 {
     ISound sound = AudioClip.Play(volume, false);
     EmittedSound emittedSound = new EmittedSound(sound);
     _playingSounds.TryAdd(emittedSound.ID, emittedSound);
     Task.Run(async () => await sound.Completed).Wait(); 
 }
Exemplo n.º 2
0
 public ISound Play(float volume, bool shouldLoop = false)
 {
     ISound sound = AudioClip.Play(volume, shouldLoop);
     EmittedSound emittedSound = new EmittedSound(sound);
     _playingSounds.TryAdd(emittedSound.ID, emittedSound);
     return sound;
 }
Exemplo n.º 3
0
 public void PlayAndWait(ISoundProperties properties = null)
 {
     ISound sound = AudioClip.Play(false, properties);
     EmittedSound emittedSound = new EmittedSound(sound);
     _playingSounds.TryAdd(emittedSound.ID, emittedSound);
     Task.Run(async () => await sound.Completed).Wait();
 }
Exemplo n.º 4
0
 public ISound Play(bool shouldLoop = false, ISoundProperties properties = null)
 {
     ISound sound = AudioClip.Play(shouldLoop, properties);
     EmittedSound emittedSound = new EmittedSound(sound);
     _playingSounds.TryAdd(emittedSound.ID, emittedSound);
     return sound;
 }
Exemplo n.º 5
0
        public void PlayAndWait(float volume)
        {
            ISound       sound        = AudioClip.Play(volume, false);
            EmittedSound emittedSound = new EmittedSound(sound);

            _playingSounds.TryAdd(emittedSound.ID, emittedSound);
            Task.Run(async() => await sound.Completed).Wait();
        }
Exemplo n.º 6
0
        public void PlayAndWait(ISoundProperties properties = null)
        {
            ISound       sound        = AudioClip.Play(false, properties);
            EmittedSound emittedSound = new EmittedSound(sound);

            _playingSounds.TryAdd(emittedSound.ID, emittedSound);
            Task.Run(async() => await sound.Completed).Wait();
        }
Exemplo n.º 7
0
        public ISound Play(float volume, bool shouldLoop = false)
        {
            ISound       sound        = AudioClip.Play(volume, shouldLoop);
            EmittedSound emittedSound = new EmittedSound(sound);

            _playingSounds.TryAdd(emittedSound.ID, emittedSound);
            return(sound);
        }
Exemplo n.º 8
0
        public ISound Play(bool shouldLoop = false, ISoundProperties properties = null)
        {
            ISound       sound        = AudioClip.Play(shouldLoop, properties);
            EmittedSound emittedSound = new EmittedSound(sound);

            _playingSounds.TryAdd(emittedSound.ID, emittedSound);
            return(sound);
        }
Exemplo n.º 9
0
        public ISound Play(float volume, bool shouldLoop = false)
        {
            ISound sound = AudioClip.Play(volume, shouldLoop);

            OnSoundStarted.Invoke(sound);
            EmittedSound emittedSound = new EmittedSound(sound);

            _playingSounds.TryAdd(emittedSound.ID, emittedSound);
            sound.Completed.ContinueWith(_ => OnSoundCompleted?.Invoke(sound));
            return(sound);
        }
Exemplo n.º 10
0
        public ISound Play(bool shouldLoop = false, ISoundProperties properties = null)
        {
            ISound sound = AudioClip.Play(shouldLoop, properties);

            OnSoundStarted.Invoke(sound);
            EmittedSound emittedSound = new EmittedSound(sound);

            _playingSounds.TryAdd(emittedSound.ID, emittedSound);
            sound.Completed.ContinueWith(_ => OnSoundCompleted?.Invoke(sound));
            return(sound);
        }