Wiki

Case Status
Log In

Wiki

 
Home ยป Add-ons»Photon Networking»Photon DemoWorker Sample»Photon DemoWork Chat target gu…
Index
Navigation
Community Wiki

Photon DemoWork Chat target gui Fsm

Display the GUI interface to let the user select the target to send the chat.

It is only displayed when the player is not alone in the room.
 
 

Displaying the chat target gui

ROOM IS EMPTY and ROOM IS BUSY are global events fired by Game : room players watcher Fsm
We use them two events to show or not the chat content text area
 
You'll notice that we assume that the room is empty on START
 

managing user choices

This aspect can be cumbersome in PlayMaker unfortunately because it lacks mechanism to define a list of selection ( like enum in scripts). We simply have to build it by hand:

for each possible user choice, we have an event ( SEND TO ALL, SEND TO MASTER, SEND TO OTHERS, etc etc) and for each of these choices, we display a gui button and bind the appropriate event that transit via these events. This is the "chat target gui" state. For each possible choices, we move to a specific state and store this choice in a string ( for example the "set target to All" state stores the string "all" in the variable "Photons targets")

Once the user made a choice and we recorded that choice, we move the "send RPC chat" state, in there we get the message to send and set the target the user just selected and send it that way.

 

Tags:

Last modified on 5/12/2012 2:28 AM by User.

  • RSS Feed