Skip to content

Commit

Permalink
FIXED game not responding when sound is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
ip0p committed May 2, 2018
1 parent 6b8cf7a commit 7e20f8f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Components/SoundManager.cs
Expand Up @@ -98,6 +98,12 @@ public AudioSource Play(string name, SoundType type, bool loop = false, float vo

var audioClip = GetAudioClip(name);

if (audioClip == null)
{
Debug.LogError("Warning! Problem playing sound " + name);
return new AudioSource();
}

return Play(audioClip, volume, 1f, loop, delay, deleteAfterSec);
}

Expand Down

0 comments on commit 7e20f8f

Please sign in to comment.