I downloaded (and imported) the v3.0 release of Pro Pooling and just encounter a bug when scripting with the Spawner.
Here's a snippet of my Spawner script on my Start event.
Code: Select all
public class UvzGamePlay : Singleton<UvzGamePlay> {
public GameObject gamePlane;
Spawner spawner;
// Replace Awake()
protected override void GameSetup() {
//Debug.Log ("Game Play setup");
}
// Use this for initialization
void Start () {
if (gamePlane != null) {
spawner = gamePlane.GetComponent<Spawner> ();
if (!string.IsNullOrEmpty (UvzPersistent.Instance.myPrefs.RawInventory)) {
spawner.StartSpawning ();
}
}
}
It seems the Start() method of SpawnOverTime is being called first so I added the spawner.SpawnOverTime.Initialise (spawner) before the spawner.StartSpawning() and it worked. (except that it calls the initialise twice);
Code: Select all
if (!string.IsNullOrEmpty (UvzPersistent.Instance.myPrefs.RawInventory)) {
spawner.SpawnOverTime.Initialise (spawner);
spawner.StartSpawning ();
}
Cheers!