public void AddRangeNonNull(List <GameObject> candidates, HashSet <GameObject> matches, CubeScript cubeScript) { for (int i = 0; i < 4; i++) { GameObject go = cubeScript.GetCubeAdjacency(i); if (go != null && !matches.Contains(go)) { candidates.Add(go); } } }