Example #1
0
    public void TouchCell(HexCell touchedCell)
    {
        Active.SelectedCell = touchedCell;
        if (Active.NkmObject != null)
        {
            UseMyGameObject(touchedCell);
        }
        else if (Active.HexCells?.Contains(touchedCell) == true)
        {
            Active.MakeAction(touchedCell);
        }
        else
        {
            if (Active.AbilityToUse != null)
            {
                return;
            }
            //possibility of highlighting with control pressed
            if (!Input.GetKey(KeyCode.LeftControl))
            {
                HexMapDrawer.RemoveHighlights();
            }
            if (touchedCell.CharacterOnCell != null)
            {
                touchedCell.CharacterOnCell.Select();
            }
            else
            {
                Active.CharacterOnMap?.Deselect();
                touchedCell.AddHighlight(Highlights.BlackTransparent);
            }
        }
//		touchedCell.GetArea(HexDirection.Ne, 6, 7).ForEach(c => c.AddHighlight(Highlights.BlueTransparent));
    }
Example #2
0
 public void Click()
 {
     Active.Prepare(this, GetTargetsInRange());
     //Show highlights on move cells
     GetTargetsInRange().ForEach(c =>
     {
         HexDirection direction = ParentCharacter.ParentCell.GetDirection(c);
         HexCell moveCell       = c.GetCell(direction, TargetCellOffset);
         moveCell.AddHighlight(Highlights.BlueTransparent);
     });
 }