public void SelectCell(HexCell cell) { ClearHighlighting(); if (selectedCell) { selectedCell.ClearHighlighting(); if (selectedCell.occupied) { HUDManager.ShowSelectedUnit(selectedCell.occupier); } else { HUDManager.HideSelectedUnit(); } } if (cell) { highlightedPath.Clear(); selectedCell = cell; selectedCell.ClearHighlighting(true); if (selectedCell.occupied) { HUDManager.ShowSelectedUnit(selectedCell.occupier); } else { HUDManager.HideSelectedUnit(); } } }
public void ManageHighlightActivated(List <Unit> units) { foreach (Unit unit in units) { HexCell cell = FindCell(unit.hex); cell?.ClearHighlighting(); } }
public void ClearHighlighting() { foreach (HexCell pathCell in highlightedPath) { pathCell.ClearHighlighting(false); } if (highlightedPath.Count > 0 && highlightedPath[0].Equals(selectedCell)) { selectedCell.Select(); } if (highlightedCell) { highlightedCell.ClearHighlighting(highlightedCell.Equals(selectedCell)); } }