playMaker

Author Topic: Custom action with asynchronous callback  (Read 5315 times)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Custom action with asynchronous callback
« Reply #15 on: July 20, 2017, 09:39:10 AM »
Hi,

 All Asynchrounous callback from Unity are using a special Class, which you simply store as a private variable inside your action and check on Update it's status.

 in your case, I assume you are using the WWW class right? check out the wwwObject action and how it handles knowing when the www content has been received back from the server.

 you need to do that same.

Now, you are mentioning userdata and not directly a www class, so are you using a framework from the asset store or something you wrote yourself?


 Bye,

 Jean

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Custom action with asynchronous callback
« Reply #16 on: July 20, 2017, 09:42:44 AM »
Hi,

 also, there are other actions that may be more meaningfull and close to what you want to achieve: check out the UnloadSceneAsynch action, it's using AsyncOperation class directly. any call you make to a Api that returns an AsynchOperation can be handled the way this action does ( essentially, the www class is an AsynchOperation too)

Bye,

 Jean

pt5011

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Custom action with asynchronous callback
« Reply #17 on: July 23, 2017, 10:28:57 PM »
Sorry for the late reply.

@ jeanfabre Thank you for your help, I will take a look at the UnloadSceneAsync action.

Thank you all for your help!