mush
New Member
Posts: 39
Posts: 39
|
Post by mush on May 7, 2015 22:40:40 GMT
Hello,
I noticed a log in the debug window which states:
Repeating matching wave from spawner: Motherships, wave# 1, level 1.
how can i count how many times the wave has repeated?
I have tried WaveSyncroPrefabSpawner._currentWave.SpawnWaveNumber but get a nullReferenceException even if i set to public static (which i would prefer not to do).
Best regards, Chris
|
|
mush
New Member
Posts: 39
Posts: 39
|
Post by mush on May 7, 2015 22:45:48 GMT
I have designated a custom event called DoNewMotherShip and added it to the new Repeat cust. events on my mothership spawner but where do write the DoNewMotherShip code?
|
|
|
Post by DarkTonic Dev on May 8, 2015 14:57:38 GMT
Hello, I noticed a log in the debug window which states: Repeating matching wave from spawner: Motherships, wave# 1, level 1. how can i count how many times the wave has repeated? I have tried WaveSyncroPrefabSpawner._currentWave.SpawnWaveNumber but get a nullReferenceException even if i set to public static (which i would prefer not to do). Best regards, Chris Make a subclass of WaveSyncroSpawnerListener and override the WaveRepeat method which gets called on each repeat. Then add your own variable to the class and increment it every time.
|
|
|
Post by DarkTonic Dev on May 8, 2015 14:59:23 GMT
I have designated a custom event called DoNewMotherShip and added it to the new Repeat cust. events on my mothership spawner but where do write the DoNewMotherShip code? If DoNewMothership event needs to just spawn things, use TriggeredSpawner (on any number of separate game objects) to listen to that event (no code needs to be written). If it needs to do something else, you'll need to make your own class implementing ICgkEventReceiver, as mentioned in the readme.
|
|
mush
New Member
Posts: 39
Posts: 39
|
Post by mush on May 8, 2015 22:57:45 GMT
Sorry for my ignorance but how and where do I make a subclass for WaveSyncroSpawnerListener?
|
|
|
Post by DarkTonic Dev on May 9, 2015 1:07:17 GMT
I can't also teach C# basics too much, but here's a start: There's a KillableListenerSubclass in the example scenes.
Notice the following:
1) For a subclass, you need to specify the parent class on the class declaration line. 2) You override only methods that you want to change, or add new methods / properties. 3) Attach the subclass you make to a game object, then drag it into the "listener" field on a Killable. If you place it on the same game object as the Killable, then it will auto-hook up and you don't need to drag.
|
|