public override void OnHit() { base.OnHit(); if (!disabled) { worldObj.OnHit(); GameOver.EndGame(); graphic.SetActive(false); GetComponent <BoxCollider> ().enabled = false; } AudioSource.PlayClipAtPoint(lib.GetClip("Explosion"), Camera.main.transform.position, AudioManager.instance.sfxVolumePercent * AudioManager.instance.masterVolumePercent * .2f); }
/// <summary> /// Plays clip with specified name from SfxLibrary /// </summary> public void PlaySfx(string name, Vector3 position, float volumeScale = 1) { //print (sfxLibrary.GetClip (name).name); PlaySfx(sfxLibrary.GetClip(name), position, volumeScale); }