Exemplo n.º 1
0
    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);
    }
Exemplo n.º 2
0
    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)]);
    }
Exemplo n.º 3
0
    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);
    }