/// <summary> /// When a hexagon is clicked, deselect previous selected hexagons. Calculate grid coord position and available other two hexagon element to complete selection to three hexagon. /// Find their middle anchored coordination and return it. /// </summary> /// <param name="anchoredPositions"></param> /// <returns></returns> public Vector2 ClickedHexagons(Vector2 anchoredPositions) { DeselectHexagons(); Vector2 coordPosition = positionCalculator.AnchoredToCoord(anchoredPositions); selectedCoords = touchMoves.GetSelectionPattern(coordPosition); SetSelectedHexagons(); List <Vector2> selectedAnchored = new List <Vector2>(); foreach (Vector2 vector in selectedCoords) { selectedAnchored.Add(positionCalculator.CoordToAnchored(vector)); } Vector2 middleCoord = positionCalculator.SetMiddleCoord(selectedAnchored); return(middleCoord); }