Destroy the object across the network.
/// <summary> /// <para>Destroy the object across the network.</para> /// </summary> /// <param name="gameObject"></param> public static void Destroy(GameObject gameObject) { if (gameObject != null) { NetworkView component = gameObject.GetComponent <NetworkView>(); if (component != null) { Network.Destroy(component.viewID); } else { Debug.LogError("Couldn't destroy game object because no network view is attached to it.", gameObject); } } }
/// <summary> /// <para>Destroy the object across the network.</para> /// </summary> /// <param name="gameObject"></param> public static void Destroy(GameObject gameObject) { if (!((Object)gameObject != (Object)null)) { return; } NetworkView component = gameObject.GetComponent <NetworkView>(); if ((Object)component != (Object)null) { Network.Destroy(component.viewID); } else { Debug.LogError((object)"Couldn't destroy game object because no network view is attached to it.", (Object)gameObject); } }