Global Callback interface for ownership changes. These callbacks will fire for changes to ANY PhotonView that changes. Consider using IOnPhotonViewControllerChange for callbacks from a specific PhotonView. More...
Public Member Functions | |
void | OnOwnershipRequest (PhotonView targetView, Player requestingPlayer) |
Called when another player requests ownership of a PhotonView. Called on all clients, so check if (targetView.IsMine) or (targetView.Owner == PhotonNetwork.LocalPlayer) to determine if a targetView.TransferOwnership(requestingPlayer) response should be given. More... | |
void | OnOwnershipTransfered (PhotonView targetView, Player previousOwner) |
Called when ownership of a PhotonView is transfered to another player. More... | |
void | OnOwnershipTransferFailed (PhotonView targetView, Player senderOfFailedRequest) |
Called when an Ownership Request fails for objects with "takeover" setting. More... | |
Global Callback interface for ownership changes. These callbacks will fire for changes to ANY PhotonView that changes. Consider using IOnPhotonViewControllerChange for callbacks from a specific PhotonView.
void OnOwnershipRequest | ( | PhotonView | targetView, |
Player | requestingPlayer | ||
) |
Called when another player requests ownership of a PhotonView. Called on all clients, so check if (targetView.IsMine) or (targetView.Owner == PhotonNetwork.LocalPlayer) to determine if a targetView.TransferOwnership(requestingPlayer) response should be given.
The parameter viewAndPlayer contains:
PhotonView view = viewAndPlayer[0] as PhotonView;
Player requestingPlayer = viewAndPlayer[1] as Player;
targetView | PhotonView for which ownership gets requested. |
requestingPlayer | Player who requests ownership. |
void OnOwnershipTransfered | ( | PhotonView | targetView, |
Player | previousOwner | ||
) |
Called when ownership of a PhotonView is transfered to another player.
The parameter viewAndPlayers contains:
PhotonView view = viewAndPlayers[0] as PhotonView;
Player newOwner = viewAndPlayers[1] as Player;
Player oldOwner = viewAndPlayers[2] as Player;
void OnOwnershipTransfered(object[] viewAndPlayers) {} //
targetView | PhotonView for which ownership changed. |
previousOwner | Player who was the previous owner (or null, if none). |
void OnOwnershipTransferFailed | ( | PhotonView | targetView, |
Player | senderOfFailedRequest | ||
) |
Called when an Ownership Request fails for objects with "takeover" setting.
Each request asks to take ownership from a specific controlling player. This can fail if anyone else took over ownership briefly before the request arrived.
targetView | |
senderOfFailedRequest |