using UnityEngine;
using System.Collections;
public class SpawnerScript : MonoBehaviour {
public GameObject ball1Prefab;
private float spawnTimer;
private float spawnCounter;
void Start()
{
spawnTimer = 1.0f;
spawnCounter = 0.0f;
}
void Update () {
spawnCounter += Time.deltaTime * 1;
if (spawnCounter >= spawnTimer) {
SpawnEgg ();
spawnCounter = 0;
}
}
void SpawnEgg()
{
Instantiate (ball1Prefab, transform.position, Quaternion.identity);
}
}