Beispiel #1
0
 public void TouchCell(HexCell touchedCell)
 {
     if (Active.MyGameObject != null)
     {
         UseMyGameObject(touchedCell);
     }
     else if (Active.HexCells?.Contains(touchedCell) == true)
     {
         Active.MakeAction(touchedCell);
     }
     else
     {
         if (Active.Ability != null)
         {
             return;
         }
         //possibility of highlighting with control pressed
         if (!Input.GetKey(KeyCode.LeftControl))
         {
             HexMapDrawer.RemoveAllHighlights();
         }
         if (touchedCell.CharacterOnCell != null)
         {
             touchedCell.CharacterOnCell.Select();
         }
         else
         {
             Active.CharacterOnMap?.Deselect();
             touchedCell.ToggleHighlight();
         }
     }
 }