예제 #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
파일: AttackSound.cs 프로젝트: sdasd30/7SS
    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);
    }