Exemple #1
0
        private void HighlightCardinal(Vector2Int direction, Tilemap tilemap)
        {
            var nodes = _ranged.CalculatePath(_player.Occupant, direction, grid.Value);

            for (int i = 0; i < nodes.Travelled.Count; i++)
            {
                if (nodes.IsLastNodeTarget && i == nodes.Travelled.Count - 1)
                {
                    var pos = grid.Value.Position00.ToVector2Int() + nodes.Travelled[i].Position;
                    tilemap.SetTile((Vector3Int)pos, attackTile);
                }
                else
                {
                    var pos = grid.Value.Position00.ToVector2Int() + nodes.Travelled[i].Position;
                    tilemap.SetTile((Vector3Int)pos, highlighted);
                }
            }
        }