Case Status
Log In


Home ยป Add-ons»Photon Networking»Photon DemoWorker Sample»Photon DemoWorker Enabler fsm
Community Wiki

Photon DemoWorker Enabler fsm

The enabler fsm activate and destroy the various gameObjects managing the various aspects of the scene: the chat, the main menu and the game itself. 

It also store the room details when we are connected

This is a critical Fsm.

This Fsm is key to the system and its functioning. The game system and chat system are assuming that this fsm does it job or enabling, disabling, and destroying the right objects depending on the context.

Scene contexts

the scene can find itself into many different situation regards the multi player environment.

  • not connected to Photon
  • connected to Photon
  • not in a room
  • in a room

Each of these context call for specific management and different gui content to display to the user.

The connection state is handled in a Menu : connection Fsm, dealing with the contexts at a higher level

Being in a room or not is handled here and when we start, because it's been design in such a way that when the user enters a room, we reload the scene completly and start fresh. So we simply ask the question "are we in a room?"

  • if we are, we activate the Game manager object and the chat system, AND we destroy the main menu because it's irrelevant in this context.
  • If we are not in a room, we destroy the game manager and thee chat system, AND we active the main menu, Only the menu should be active, so that the user can create or join room.

you'll notice that after we've done the work, we destroy this very gameObject, because we don't need it anymore. So really this Fsm only exists for short time when the scene is loading, activating and destroy what's required and then goes away, because we know that if the context changes the scene will be reloaded.


Photon Actions used:



Last modified on 5/18/2012 2:54 AM by User.

  • RSS Feed