Wiki

Case Status
Log In

Wiki

 
Home ยป Add-ons»Photon Networking»Photon DemoWorker Sample»Photon DemoWorker Quit Manager…
Index
Navigation
Community Wiki

Photon DemoWorker Quit Manager Fsm

Implement the gui and logic for quitting or leaving the game.

This is a critical Fsm.

This Fsm is relying on the fact the the "game" gameObject doesn't exists when the user is not in a room.

This Fsm has two functions:

  1. We display the Quit button. Since we assume we only exists when the user is in a room, we do that as soon as we START If the user press the button, we transit through the QUIT event we created for the occasion, and make a simply call to the photon system to tell it we want to leave the room. 
  2. Instead of relying on the user leaving the room manually, we use the Photon Events to let the system tell us we indeed left the room or that we disconnected ( likely because an internet connection failure). We do that by simply watching PHOTON / LEFT ROOM and PHOTON / DISCONNECTED FROM PHOTON We can afford do do that because the action we need on both case is the same: we reload the scene. This is one clear benefit of reloading every time the scene when the status of the game changes.

Photon Actions used:

Photon Events used

Tags:

Last modified on 5/28/2012 4:49 AM by User.

  • RSS Feed