playMaker

Author Topic: extend system event  (Read 1851 times)

piranha305

  • Playmaker Newbie
  • *
  • Posts: 2
extend system event
« on: April 01, 2014, 12:34:34 PM »
Hi, is there a way to extend the custom system events (ontriggereneter for example) like my question really is how are the proxy objects implemented like the unity 2d events and ngui events to receive those system calls and how would someone go about implementing thier own system events, I'm guessing it's using delegates in some way but I'm not too sure?
« Last Edit: April 01, 2014, 12:39:49 PM by piranha305 »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: extend system event
« Reply #1 on: April 02, 2014, 07:30:28 AM »
Hi,

 Unity 2d and ngui port to PlayMaker are open source, simply look at the proxies and scripts.
 

for Unity 2d, it's not using delegate, I simply compose the monobehavior calls in a proxy scripts to then send a playmaker event.

for Ngui, I rely on ngui sending messages to the gameobject.

 for delegate based proxies, look at Input.touch implementation for example.

What framework do you want to port to PlayMaker?

bye,

 Jean

piranha305

  • Playmaker Newbie
  • *
  • Posts: 2
Re: extend system event
« Reply #2 on: April 03, 2014, 01:41:54 AM »
would it have been possible to implement the unity2d and ngui with delegates?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: extend system event
« Reply #3 on: April 03, 2014, 07:04:10 AM »
Hi,

Unity 2d: no, cause they don't have any delegates.

Ngui: indeed, it's totally possible, you can use ngui delegates to create bridges with playmaker.  A PlayMaker custom action can register delegates from anywhere really, there is no restricitions here. Also, you have to be aware that them this delegate needs to be properly dismissed when the action exits, and also the obvious fact that it can not be a "global" system within a fsm, it can only be for a specific state, which is why I went for proxies, cause then I simply fire an event to a fsm, which is a lot easier to implement and deal with in most cases then having to implement a specific fsm dealing with a particular event in a particular state and do all this tedious work anproxy do just fine.


 Bye,

 Jean