Quantum 3 3.1.0

Public Member Functions | List of all members
Photon.Realtime.IOnEventCallback Interface Reference

Event callback for the Realtime Api. Covers events from the server and those sent by clients via OpRaiseEvent. More...

Public Member Functions

void OnEvent (EventData photonEvent)
 Called for any incoming events. More...
 

Detailed Description

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 RealtimeClient.AddCallbackTarget and pass the class implementing this interface To stop getting callbacks, call RealtimeClient.RemoveCallbackTarget and pass the class implementing this interface

Member Function Documentation

◆ OnEvent()

void Photon.Realtime.IOnEventCallback.OnEvent ( EventData  photonEvent)

Called for any incoming events.

To receive events, implement IOnEventCallback in any class and register it via AddCallbackTarget (either in RealtimeClient 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.