PUN and Photon Realtime .Net SDKs provide a set of callback interfaces that you can implement in your classes:
IConnectionCallbacks: connection related callbacks.
IInRoomCallbacks: callbacks that happen inside the room.
ILobbyCallbacks: lobby related callbacks.
IMatchmakingCallbacks: matchmaking related callbacks.
IOnEventCallback: a single callback for any received event. This is 'equivalent' to the C# event
IWebRpcCallback: a single callback for receiving WebRPC operation response.
IPunInstantiateMagicCallback: a single callback for instantiated PUN prefabs.
IPunObservable: PhotonView serialization callbacks.
IPunOwnershipCallbacks: PUN ownership transfer callbacks.
All callback interfaces except
IPunInstantiateMagicCallback must be registered and unregistered.
For example in Unity, you could use the
If you extend
MonoBehaviourPunCallbacks make sure to call the base class methods if you override