// manage selected grid objects public void AddSelected(GridObject newlySelected) { if (selectedGridObject == null) { audio.PlayOneShot(selectSound); selectedGridObject = newlySelected; } else { if ((grid.AdjacentGridObjects(newlySelected).Contains(selectedGridObject))) { grid.Switch(selectedGridObject, newlySelected); switchingObjects.Add(selectedGridObject); switchingObjects.Add(newlySelected); newlySelected.BeNotSelected(); selectedGridObject.BeNotSelected(); selectedGridObject = null; } else { audio.PlayOneShot(selectSound); selectedGridObject.BeNotSelected(); selectedGridObject = newlySelected; } } }