Beispiel #1
0
 /// <summary>
 /// Depending on the PhotonView's OwnershipTransfer setting, any client can request to become owner of the PhotonView.
 /// </summary>
 /// <remarks>
 /// Requesting ownership can give you control over a PhotonView, if the OwnershipTransfer setting allows that.
 /// The current owner might have to implement IPunCallbacks.OnOwnershipRequest to react to the ownership request.
 ///
 /// The owner/controller of a PhotonView is also the client which sends position updates of the GameObject.
 /// </remarks>
 public void RequestOwnership()
 {
     if (OwnershipTransfer != OwnershipOption.Fixed)
     {
         PhotonNetwork.RequestOwnership(this.ViewID, this.ownerActorNr);
     }
     else
     {
         if (PhotonNetwork.LogLevel >= PunLogLevel.Informational)
         {
             Debug.LogWarning("Attempting to RequestOwnership of GameObject '" + name + "' viewId: " + ViewID +
                              ", but PhotonView.OwnershipTranfer is set to Fixed.");
         }
     }
 }
Beispiel #2
0
 /// <summary>
 /// Depending on the PhotonView's OwnershipTransfer setting, any client can request to become owner of the PhotonView.
 /// </summary>
 /// <remarks>
 /// Requesting ownership can give you control over a PhotonView, if the OwnershipTransfer setting allows that.
 /// The current owner might have to implement IPunCallbacks.OnOwnershipRequest to react to the ownership request.
 ///
 /// The owner/controller of a PhotonView is also the client which sends position updates of the GameObject.
 /// </remarks>
 public void RequestOwnership()
 {
     PhotonNetwork.RequestOwnership(this.ViewID, this.ownerId);
 }