seb33
New Member
Posts: 17
Posts: 17
|
Post by seb33 on Feb 14, 2017 14:14:49 GMT
Am getting confused with delaying the spawning of prefabs. Currently am using PoolBoss.Spawn within a loop. I have 2 waves within 1 level but it's timings does not appear to be used - instead all the prefabs are spawned at once under the poolboss parent. I need to be able to delay spawning, but does this mean I shouldn't be using PoolBoss.Spawn with this scenario? Any help much appreciated.
|
|
|
Post by DarkTonic Dev on Feb 14, 2017 16:24:45 GMT
First I need to ask why are you not using our spawners? They handle all this and a lot more with no coding.
|
|
seb33
New Member
Posts: 17
Posts: 17
|
Post by seb33 on Feb 14, 2017 17:17:31 GMT
Not sure how to use the spawners as in this case I cannot know the prefabs position ahead of runtime.
|
|
|
Post by DarkTonic Dev on Feb 14, 2017 17:36:34 GMT
Your spawners can move around, that's fine. Use a Syncro Spawner and set up its wave to spawn over time. Example Scene #1 you can look at, but add a movement script to the spawners if you need that.
There's a "delay wave" field and also a field that controls how long it takes for the whole wave to spawn.
|
|
seb33
New Member
Posts: 17
Posts: 17
|
Post by seb33 on Feb 15, 2017 12:55:04 GMT
Thanks for the info, really appreciate it. As well as setting a custom transform is there an easy way to tack further data to the spawned prefabs at runtime? Am thinking soomething along the lines of custom exposed properties??
|
|
|
Post by DarkTonic Dev on Feb 15, 2017 17:02:01 GMT
You'll need to code that. Use the OnSpawned method that gets fired every time it spawns if the custom data can be retrieved from a global manager script. If not, then use a WaveSyncroSpawnerListener class, hook it to the spawner, and add code to the ItemSpawned method.
|
|
seb33
New Member
Posts: 17
Posts: 17
|
Post by seb33 on Feb 15, 2017 22:40:58 GMT
Great plan, have a way forward; thanks
|
|
|
Post by DarkTonic Dev on Feb 15, 2017 22:49:31 GMT
No problem.
|
|