void DestroyObject() { for (int i = 0; i < energy.Count; i++) { Energy tempEnergy = energy[i].GetComponent <Energy>(); tempEnergy.DestroyObject(); } Destroy(this.gameObject); }