示例#1
0
    public void Play(Soundy soundy)
    {
        var randomSoundIndex = Random.Range(0, soundy.Sounds.Count);
        var sound            = soundy.Sounds[randomSoundIndex];

        AudioController.Instance.PlaySound(sound, false, Random.Range(soundy.MinVolume, soundy.MaxVolume), Random.Range(soundy.MinPitch, soundy.MaxPitch));
    }
示例#2
0
 private void Awake()
 {
     soundy = FindObjectOfType <Soundy>();
 }
示例#3
0
    public void Play(string name)
    {
        Soundy s = Array.Find(sounds, sound => sound.name == name);

        s.source.Play();
    }