23.05.2016, 08:51
You can write your own EventHandler, which can call the function from objects too. What you need send to him it sholud be name of function as string, and object address (in class just send "this")
my EventHandler work like that
And i add to him like this
my EventHandler work like that
Code:
evetns_onHit <- EventHandler(); //Global object
function onHit(targetID, killerID){
events_onHit.call(targetID, killerID);
}
And i add to him like this
Code:
in class
function hookCallbacks(){
events_onHit.add("myOwnOnHit", this);
}
function myOwnOnHit(targetID, killerID){}