Esempio n. 1
0
    void TileSelect(HexTile tile)
    {
        if (!tile)
        {
            gameManager.mapManager.SetSelectedTile(null);
            return;
        }

        HexTile lastSelected = gameManager.mapManager.lastSelectedTile;

        if (!lastSelected && tile.HasTeam())
        {
            gameManager.mapManager.SetSelectedTile(tile);
            OnSelected?.Invoke();
        }
        else if (lastSelected && tile != lastSelected)
        {
            gameManager.mapManager.SetFinalPath(tile);
            OnMoveOrder?.Invoke();
        }
        else if (lastSelected && tile == lastSelected && !tile.Excavated())
        {
            gameManager.mapManager.DeselectAll();
            gameManager.TurnDig(tile);
        }
        else
        {
            OnActionDenided.Invoke();
        }
    }
Esempio n. 2
0
    private void DebugInput()
    {
        if (Input.GetMouseButtonDown(1))
        {
            HexTile tile = TileAtMouse();
            if (!tile)
            {
                return;
            }

            if (!gameManager.mapManager.Reveal(tile))
            {
                if (!tile.Excavated())
                {
                    List <Artifact> excavated = tile.Excavate();
                    //Debug.Log("Excavated " + excavated.Count + " artifacts!");
                }
            }
        }
    }