playMaker

Author Topic: Checking Playmaker FSM Loading status.  (Read 2273 times)

marcusjung

  • Playmaker Newbie
  • *
  • Posts: 10
Checking Playmaker FSM Loading status.
« on: February 28, 2014, 12:21:07 AM »
Hi.
I'm sorry, My english is not good.

How do i know that all FSM(playmaker) Loading is done?
After all Fsm loaded,
I wanna send a broadcast event message.
but I cant know playmaker FSM loading status in the scene.
 



Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4255
  • Official Playmaker Support
    • LinkedIn
Re: Checking Playmaker FSM Loading status.
« Reply #1 on: February 28, 2014, 04:08:10 PM »
Are you loading a regular scene? Or are you using any async/background loading?

In a regular scene all FSMs should be loaded before the first update.

However things get a little tricky because there's no guaranteed order that Unity updates MonoBehaviours. So you don't know if one FSM has run before another one.

If you want to play it safe you can use the Next Frame Event to delay the Broadcast by one frame, ensuring that all FSMs have run at least one update before you Broadcast.

If you're doing any kind of async loading the loading FSM should broadcast an event when loading is finished. Then other FSMs can respond to that event...

marcusjung

  • Playmaker Newbie
  • *
  • Posts: 10
Re: Checking Playmaker FSM Loading status.
« Reply #2 on: February 28, 2014, 06:58:49 PM »
I'm using regular scene.
Thanks for your help.