Beispiel #1
0
    public void SelectUnit(UnitScript unit)
    {
        Debug.Log(unit.name + " SELECTED");
        DeselectUnit();

        unit.Select();
        selectedUnit = unit;

        if (unit.currentWorldTile != null)
        {
            // update movable tiles
            unit.RefreshMovableTiles();
            // show movable tiles
            overlayManager.ShowMovableTiles(unit.movableTiles);

            //Debug.Log(unit.currentWorldTile.coordinates);
            foreach (var t in unit.currentWorldTile.neighbors)
            {
                //Debug.Log("NEIGHBOR: " + t);
            }
            HashSet <Vector3Int> twd = unit.currentWorldTile.GetTilesWithinDistance(2.1f);
            Debug.Log(twd.Count);
            foreach (var t in twd)
            {
                Debug.Log(t);
            }
        }
    }