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

NetworkDestroy() публичный статический Метод

Destroy a Simple Networked Monobehavior or any of its derivitives with the given Network ID
public static NetworkDestroy ( ulong networkId ) : bool
networkId ulong Network ID to be destroyed
Результат bool
		public static bool NetworkDestroy(ulong networkId)
		{
			// Make sure the object exists on the network before calling destroy
			SimpleNetworkedMonoBehavior behavior = Locate(networkId);

			if (behavior == null)
				return false;

			// Destroy the object from the scene and remove it from the lookup

			GameObject.Destroy(behavior.gameObject);

			lock (networkedBehaviorsMutex)
			{
				networkedBehaviors.Remove(networkId);
			}

			if (Networking.PrimarySocket.IsServer)
				Networking.PrimarySocket.ClearBufferedInstantiateFromID(networkId);

			return true;
		}