using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class spawner : MonoBehaviour
|
|
{
|
|
public GameObject childPrefab;
|
|
|
|
public float spawnTime;
|
|
private float timer = 0;
|
|
|
|
public int startingAmount = 100;
|
|
|
|
void Start()
|
|
{
|
|
for (int x = 0; x < startingAmount; x++)
|
|
{
|
|
SpawnBaby();
|
|
}
|
|
}
|
|
|
|
public void SpawnBaby()
|
|
{
|
|
float _x = Random.Range(-45, 45);
|
|
float _z = Random.Range(-35, 35);
|
|
|
|
var _newChild = Instantiate(childPrefab, new Vector3(_x, 1.5f, _z), Quaternion.identity);
|
|
_newChild.transform.parent = this.transform;
|
|
}
|
|
}
|