Post by Andy on Nov 21, 2014 19:20:03 GMT
I'm having problems wiring my code up to Core Gamekit. My game has a single Unity scene, and I want to create waves on-the-fly based on a configuration file. So, if they're on game level 1, I would create "wave 1" and so on. The data reader would create the new wave and set values like delay and number of enemies to spawn.
I have a single enemy spawner.
I'm having problems wiring my code to Core Gamekit. Some things I tried (I don't have the code in front of me):
1) InsertLevel and InsertWave combined with FindWave(): the InsertLevel and InsertWave methods check a list (List<WaveSettings). That list is empty (debugger) so FindWave returns null.
2) I looked at LevelSettings to see if I could get a handle to the list of levels or waves. It was not exposed (that I could tell). It seems like that information is only exposed in the syncro scripts.
3) I thought about building all of the possible levels/waves in the Core Gamekit interface. Then, I'd use DeleteLevel (DeleteWave?) to drop out all of the levels and waves I wasn't using on that particular game level. I didn't have time to try this idea. And, I'd prefer to be able to build a Wave on the fly instead of deleting the 100+ waves I'm not using on a particular game level.
4) I looked through the API and the forum for things like AddWave() and AddLevel().
Does that make sense? Is it supported? Do you have a suggestion or sample code?
I create a PoolBoss with all of the prefabs (30+). Because I have a single scene, I don't want to pre-load all of the prefabs since most of them will not be used on a particular game level. I set the minimum quantity of the PoolItems to 0. In my code, I grab the PoolBoss and then programmatically change the preload quantity for the few prefabs used in the particular game level.
I wired it together but I haven't tested the concept because I haven't solved the level question above. I'm wondering it this will work like I hope (i.e. that after I run my script, the PoolBoss will not spawn prefabs with quantity 0 but will spawn prefabs with quantity >0).
Thanks in advance