示例#1
0
    public void PlaySound(Sound.SoundName name)
    {
        Sound s = Array.Find(sounds, sound => sound.name == name);

        if (s.source.isPlaying)
        {
            return;
        }
        s.source.Play();
    }
示例#2
0
    public void PlaySoundOneShot(Sound.SoundName name)
    {
        Sound s = Array.Find(sounds, sound => sound.name == name);

        s.source.PlayOneShot(s.audioClip);
    }