public void DeleteFloor(Transform target) { if (target != null) { FloorController targetController = target.GetComponent <FloorController>(); floorParts.Remove(targetController); targetController.GetRidOfMe(); } }