public DestroyPlayerObjects ( int playerId, bool localOnly ) : void | ||
playerId | int | |
localOnly | bool | |
Результат | void |
/// <summary> /// Destroy all GameObjects/PhotonViews of this player. /// </summary> /// <param name="player"></param> public static void DestroyPlayerObjects(PhotonPlayer player) { if (!VerifyCanUseNetwork()) { return; } networkingPeer.DestroyPlayerObjects(player); }
public static void DestroyPlayerObjects(int targetPlayerId) { if (VerifyCanUseNetwork()) { //if (!player.isMasterClient && (targetPlayerId != player.ID)) { // Debug.LogError("DestroyPlayerObjects() failed, cause players can only destroy their own GameObjects. A Master Client can destroy anyone's. This is master: " + isMasterClient); //} else { networkingPeer.DestroyPlayerObjects(targetPlayerId, false); //} } }
public static void DestroyPlayerObjects(int targetPlayerId) { if (VerifyCanUseNetwork()) { if (player.isMasterClient || targetPlayerId == player.Id) { networkingPeer.DestroyPlayerObjects(targetPlayerId, localOnly: false); } else { Debug.LogError("DestroyPlayerObjects() failed, cause players can only destroy their own GameObjects. A Master Client can destroy anyone's. This is master: " + isMasterClient); } } }
public static void DestroyPlayerObjects(int targetPlayerId, bool local = false) { if (VerifyCanUseNetwork() && (targetPlayerId != player.ID)) { if (player.isMasterClient || (targetPlayerId == player.ID)) { if (local) { networkingPeer.SendDestroyOfAllTo(targetPlayerId); } networkingPeer.DestroyPlayerObjects(targetPlayerId, false); } else { Debug.LogError("DestroyPlayerObjects() failed, cause players can only destroy their own GameObjects. A Master Client can destroy anyone's. This is master: " + isMasterClient); } } }