Event callback for the Realtime Api. Covers events from the server and those sent by clients via OpRaiseEvent. More...
Inherited by PunTurnManager.
Public Member Functions | |
void | OnEvent (EventData photonEvent) |
Called for any incoming events. More... | |
Event callback for the Realtime Api. Covers events from the server and those sent by clients via OpRaiseEvent.
Classes that implement this interface must be registered to get callbacks for various situations.
To register for callbacks, call LoadBalancingClient.AddCallbackTarget and pass the class implementing this interface To stop getting callbacks, call LoadBalancingClient.RemoveCallbackTarget and pass the class implementing this interface
void OnEvent | ( | EventData | photonEvent | ) |
Called for any incoming events.
To receive events, implement IOnEventCallback in any class and register it via AddCallbackTarget (either in LoadBalancingClient or PhotonNetwork).
With the EventData.Sender you can look up the Player who sent the event.
It is best practice to assign an eventCode for each different type of content and action, so the Code will be essential to read the incoming events.
Implemented in PunTurnManager.