BeardedManStudios.Network.NetworkedMonoBehavior.ProximityOutCheck C# (CSharp) Method

ProximityOutCheck() public method

public ProximityOutCheck ( NetworkedMonoBehavior other ) : void
other NetworkedMonoBehavior
return void
		public void ProximityOutCheck(NetworkedMonoBehavior other)
		{
			if (!OwningNetWorker.IsServer)
				return;

			if (!proximityBehaviors.Contains(other.NetworkedId))
				return;

			proximityBehaviors.Remove(other.NetworkedId);
			other.proximityBehaviors.Remove(this.NetworkedId);

			if (IsServerOwner)
				Unity.MainThreadManager.Run(other.ExitedProximity);
			else
				other.AuthoritativeRPC("ExitedProximity", OwningNetWorker, OwningPlayer, false);

			if (other.IsServerOwner)
				Unity.MainThreadManager.Run(ExitedProximity);
			else
				AuthoritativeRPC("ExitedProximity", OwningNetWorker, other.OwningPlayer, false);
		}