The Photon module comes with a set of Igniters or Triggers that are called when when photon events happens like On Connected, On Joined Room etc.
This event handle pretty much all Photon Events. Some of them like:
OnConnectedToPhoton: Called when the initial connection got established but before you can use the server. OnJoinedLobby or OnConnectedToMaster are called when PUN is ready.
OnLeftRoom: Called when the local user/client left a room.
OnCreatedRoom: Called when this client created a room and entered it. OnJoinedRoom will be called as well.
OnJoinedRoom: Called when entering a room (by creating or joining it). Called on all clients (including the Master Client).
And more.. To see the full list head to the Photon Events page.
This event it's called when the Photon Network connection state changes and also store the current state in a local or global variable.