public void deselectAll() { foreach (KeyValuePair <int, GameObject> pair in selectedTable) { if (pair.Value != null) { Destroy(selectedTable[pair.Key].GetComponent <selection_component>()); } } selectedTable.Clear(); uHandler.ClearSelected(); //size=0; }