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

public class MobSpawner : MonoBehaviour
{

    public GameObject[] possibleSpawns;

    public float maxCooldown;
    private float currentCooldown = 0;
    // Use this for initialization
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {
        if(currentCooldown<=0)
        {
            currentCooldown = maxCooldown;
            SpawnRandomSet();
        }
        else
        {
            currentCooldown -= Time.deltaTime;
        }
    }

    public void SpawnRandomSet()
    {
        GameObject instance = Instantiate(possibleSpawns[Random.Range(0, possibleSpawns.Length)], new Vector3(this.transform.position.x,this.transform.position.y+(Random.Range(-1,5))), Quaternion.identity);
    }
}
