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