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

public class Spawner : MonoBehaviour
{

    public Minion[] prefabs;
    

    // Start is called before the first frame update
    void Start()
    {
        InvokeRepeating("Spawn", 0, 0.5f); // :)
    }

    private void Spawn()
    {
        Vector3 position = Random.onUnitSphere * 3;
        position.y = 1;

        Minion minion = Instantiate<Minion>(prefabs[Random.Range(0, prefabs.Length)], position, Quaternion.identity);
        minion.moveSpeed = 10;
    }
}
