Exemplo n.º 1
0
    public void RedrawHighlights()
    {
        current.GenerateArea();
        for (int i = 0; i < current.length; i++)
        {
            for (int j = 0; j < current.length; j++)
            {
                if (current.area[i, j])
                {
                    highlights[i, j].Show();
                }
                else
                {
                    highlights[i, j].Hide();
                }
            }
        }

        Vector2Int offset = -current.origin + new Vector2Int(current.offset, current.offset);

        foreach (Vector2Int p in current.points)
        {
            Vector2Int spot = p + offset;
            highlights[spot.x, spot.y].Show(Color.green);
        }

        Vector2Int currentSpot = current.target + offset;

        targetingIcon.anchoredPosition = new Vector2(currentSpot.x - current.length / 2, currentSpot.y - current.length / 2);
        //highlights[currentSpot.x, currentSpot.y].Show(Color.blue);
    }