public void ClearItems(bool immediate = false) { foreach (ListItem item in this.items) { EntityBehaviour.CleanUp(item.gameObject); if (immediate) { DestroyImmediate(item.gameObject); continue; } Destroy(item.gameObject); } this.items.Clear(); this.selectedItem = null; this.position = 0f; this.targetItemIndex = 0; this.velocity = 0f; this.animating = false; this.ApplyPosition(); }