BeardedManStudios.Network.SimpleNetworkedMonoBehavior.ServerChangeOwner C# (CSharp) Метод

ServerChangeOwner() приватный Метод

private ServerChangeOwner ( ulong newOwnerPlayerId ) : void
newOwnerPlayerId ulong
Результат void
		private void ServerChangeOwner(ulong newOwnerPlayerId)
		{
			if (!OwningNetWorker.IsServer || !allowOwnershipChange)
				return;

			NetworkingPlayer player = null;
			player = OwningNetWorker.Players.Find(x => x.NetworkId == newOwnerPlayerId);

			if (player != null || newOwnerPlayerId == 0)
				RPC("AssignNewOwner", newOwnerPlayerId);
			else
				Debug.LogError("No such player with id " + newOwnerPlayerId + " currently connected.");
		}