public void playSound(AudioClip sound) { manager = FindObjectOfType <RecieveSFX>(); if (manager == null) { Debug.Log("No SFXManager in scene! Create one for button sounds to play"); } manager.playSound(sound); }
public void playSound() { RecieveSFX[] objs = FindObjectsOfType <RecieveSFX>(); foreach (RecieveSFX item in objs) { if (item.identifySelf().Equals("Living")) { //Debug.Log("Living manager identified"); manager = item; } } if (manager == null) { Debug.Log("No LivingSFXManager in scene! Create one for death sounds to play"); } manager.playSound(sounds[Random.Range(0, sounds.Count)]); }
public void playSound(AudioClip sent) { RecieveSFX[] objs = FindObjectsOfType <RecieveSFX>(); foreach (RecieveSFX item in objs) { if (item.identifySelf().Equals("Attacks")) { //Debug.Log("Attack manager identified"); manager = item; } } if (manager == null) { Debug.Log("No SFXManager in scene! Create one for attack sounds to play"); } //Debug.Log("Attempting to play " + sent); manager.playSound(sent); }