public static void PlayBadSound() { BadSound soundSource = GameObject.FindObjectOfType <BadSound>(); soundSource.GetComponent <AudioSource>().volume = soundEffectVolume * 0.1f; soundSource.GetComponent <AudioSource>().Play(); }
// Use this for initialization void Start() { BadSound.instance = this; }