//Highlights the tilemap for movement and card range. public void Highlight(Vector3 pos, Card.RangeType rt, int area, HighlightTiles.TileType type, List <Card.TargetType> validTypes) { Vector3Int location = WorldToCellSpace(pos); switch (rt) { case Card.RangeType.Area: highlights.FloodFill(location, area, type, validTypes); break; case Card.RangeType.Row: case Card.RangeType.Cross: highlights.FillCross(location, area, type, validTypes); break; } }
//highlights tiles when moused over a potential target in red. public void Target(Vector3 pos, Card.RangeType rt, int area, HighlightTiles.TileType type, List <Card.TargetType> validTypes) { Vector3Int origin = WorldToCellSpace(pos); targets.Clear(); if (highlights.Contains(origin)) { switch (rt) { case Card.RangeType.Area: targets.FloodFill(origin, area, type, validTypes); break; case Card.RangeType.Row: targets.FillRow(origin, area, type, validTypes); break; case Card.RangeType.Cross: targets.FillCross(origin, area, type, validTypes); break; } } }