using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class RandomSoundPlayer : MonoBehaviour {

    AudioSource[] audios;
    private float delay;

	// Use this for initialization
	void Start () {
        this.audios = GetComponentsInChildren<AudioSource>();
        this.delay = Random.Range (2.0f, 6.0f);
	}
	
	// Update is called once per frame
	void Update () {
        if (delay < 0) {

            this.audios[Random.Range(0, this.audios.Length)].Play();
            this.delay = 10 + Random.Range (2.0f, 8.0f);
        }

        delay -= Time.deltaTime;
	}
}
