BeardedManStudios.Network.NetworkingManager.Disconnect C# (CSharp) Method

Disconnect() public method

public Disconnect ( ) : void
return void
		public override void Disconnect()
		{
			base.Disconnect();

			ControllingSocket = null;

			Unity.UnityEventObject.onDestroy -= SkipResetOnDestroy;

			if (Threading.ThreadManagement.IsMainThread)
				Destroy(gameObject);
			else
				Unity.MainThreadManager.Run(() => { Destroy(gameObject); }); // JM: make sure this is run on main thread

			instance = null;
		}