I'm Currently creating a tycoon game, and i've got a problem on how to spawn random objects for the customer. this is not the first time, i learned Random Spawning once, 2 ago from other genre, but in Unity 5.3, if i'm not wrong. so i have to start from scratch again. so i tried a tutorial video, and here's how the coding goes, with a little modification:
public Text TimerText;
public float LevelTimeLimit;
private bool FullTime = false;
public Text TimerText;
public float LevelTimeLimit;
private bool FullTime = false;
public GameObject[] ObjPrefabs;
[System.Serializable]
public class myPool{
public string tag;
public GameObject Customer;
public int ServiceTime;
}
public List<GameObject> CustomerPool;
public Dictionary<string, Queue<GameObject>> PoolDictionary;
public GameObject GetCust(string type)
{
for (int i = 0; i < ObjPrefabs.Length; i++)
{
GameObject newObject = (GameObject)Instantiate(ObjPrefabs[i]);
newObject.SetActive(false);
CustomerPool.Add(newObject);
}
return null;
}
my problem is it won't spawn random customer. anybody know what did i miss?