Esempio n. 1
0
    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();
            }
        }
    }
Esempio n. 2
0
 public void ManageHighlightActivated(List <Unit> units)
 {
     foreach (Unit unit in units)
     {
         HexCell cell = FindCell(unit.hex);
         cell?.ClearHighlighting();
     }
 }
Esempio n. 3
0
    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));
        }
    }