playMaker

Author Topic: Declare global event through script  (Read 1523 times)

mochatony

  • Playmaker Newbie
  • *
  • Posts: 7
Declare global event through script
« on: December 11, 2013, 01:08:30 AM »
Hello

Would like to know is it possible to create global event from script, so I wouldn't have to manually create the global event again when I create new project.

Is better to able to declare from playmaker action script, as I import it and have the event ready. Something like ["NGUI/Click"].

Thank you





jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Declare global event through script
« Reply #1 on: December 11, 2013, 02:45:33 PM »
Hi,

 I whish it was possible too, but I am not aware of anything like that. I resort to the following:

 I create a prefab, with a fsm, with NO logic, and simply declare in there my gloval events.

note that it's not always necessary to drop that prefab in the scene, but if you don't get them global event listed, it's because playmaker hasn't scanned the assets, so simply drop it in the scene, and they will register for you to work, once a fsm links to this event, then it's ok, the prefab is not required anymore to be present in the scene.

 look at the photon implementation, it uses this trick: check out the prefab "PlayMaker Photon Proxy"

bye,

 Jean