//Shifts all the flowers to the next slot in the list public void reSortFlowerList() { if (currentTab == TabType.Flowers) { int ii = 0; MenuSlotItem previousItem = null; while (ii < homeFlowerSlots.Count) { MenuSlot fromSlot = homeFlowerSlots[ii].GetComponent <MenuSlot>(); MenuSlotItem tempItem = fromSlot.getItem(); fromSlot.setItemNoSort(previousItem); previousItem = tempItem; //Break out of the lop if (previousItem == null) { break; } ii += 1; } if (previousItem != null) { Destroy(previousItem.gameObject); } } }