示例#1
0
文件: ButtonSFX.cs 项目: sdasd30/7SS
    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);
    }
示例#2
0
文件: HurtSound.cs 项目: sdasd30/7SS
    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)]);
    }
示例#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);
    }