rayfigs
New Member
Posts: 9
Posts: 9
|
Post by rayfigs on May 3, 2015 8:57:31 GMT
I am using Pool boss to manage object pooling in my scene and would like to execute some code when an object is respawned. I was shuffling around and thing that using a killable listener within the listenable section of a killable object would do the trick but I am not sure. I am trying to look for an example on how the listener section is used. In the docs it mentions that it is recommended to create a subclass of the original killable listener class and I don't know how that is done or how to use subclasses. Could anyone kindly point me in the direction of such an example of where the listeners are used and how to set up the killable listener ?
Many thanks,
Reinaldo
|
|
|
Post by DarkTonic Dev on May 3, 2015 16:58:39 GMT
There's a KillableSubclass.cs in the Example Scenes folder. It's not actually used in any Scene but it's there to check out.
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 KillableSubclass to a prefab instead of Killable, then use its Inspector as normal.
|
|
|
Post by DarkTonic Dev on May 3, 2015 17:00:19 GMT
Listeners are dragged in a "Listener" field in any of the 9 listener enabled classes and then add code to whichever methods you want to do something, after subclassing.
|
|
rayfigs
New Member
Posts: 9
Posts: 9
|
Post by rayfigs on May 3, 2015 17:51:28 GMT
Looks like the docs had the answer and even provided an example, fantastic.
Edit: oh and the response was equally helpful Thank you!
|
|
|
Post by DarkTonic Dev on May 3, 2015 20:40:01 GMT
No problem, let us know if there's anything you need more clarification on or that the docs are subpar. We try to be very thorough with the documentation but it is very long.
|
|