void SelectionHighlights(FileItem item, bool wasDoubleClick) { if (!(currentlySelectedItem == item.gameObject)) { Color col; //deselect previously selected item if (currentlySelectedItem != null) { col = currentlySelectedItem.GetComponent <Image>().color; col.a = 0.5f; currentlySelectedItem.GetComponent <Image>().color = col; } //set new selected currentlySelectedItem = item.gameObject; col = item.GetComponent <Image>().color; col.a = 1.0f; item.GetComponent <Image>().color = col; } }