public static void FindSquareTower(int direction, FieldIndex ind, Field<bool> taken, ref List<Tower> buildList) { Tower newTower = new Tower(); newTower.type = TowerType.skillCap; //Debug.Log("Found 2nd piece forward on "+ind.ToString()); newTower.Add(ind); FieldIndex tmp = ind.Up(direction); newTower.Add(tmp); ind = tmp.Right(direction); //Debug.Log("Looking for 3rd piece forward on "+tmp.ToString()); if(ind.index != -1 && taken[ind]==true){ newTower.Add(ind); ind = ind.Down(direction); //Debug.Log("Looking for 4th piece right on "+tmp.ToString()); if(ind.index != -1 && taken[ind]==true){ newTower.Add(ind); // Debug.Log(newTower.ToString()); buildList.Add(newTower); } } }