public void DeleteObject(GameObject item) { ObjectScript script = (ObjectScript)item.GetComponent("ObjectScript"); Debug.Log(item.name); script.delete(); }
public void delete() { foreach (GameObject child in children) { ObjectScript script = (ObjectScript)child.GetComponent("ObjectScript"); script.delete(); } gameObject.active = false; }