Пример #1
0
 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);
 }
Пример #2
0
 /// <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);
 }