Hello there,
I am doing a get() and a set() function to comunicate two scripts.
Set works perfectly, the problem is with the get().
Here you can see my code:
//script_1
this.stateButton.button.on('click', function (event) {
var response = this.app.fire('script2:getPlayer');
console.log(response);
}, this);
//script_2
app.on('script2:getPlayer', function () {
return this.getPlayer();
}, this);
Script2.prototype.getPlayer = function () {
return "Here is your player";
};
Is there any way to achive this?